Results 1 to 9 of 9

Thread: [RESOLVED] Disable form drag ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Resolved [RESOLVED] Disable form drag ?

    Is there a way to disable a user from dragging a form other than setting the form border style to "None" ?

  2. #2

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Re: Disable form drag ?

    Ok ive set the Controlbox menu to "false" in the properties menu , that removes the minimize , maximize , close options on the form which is also helpful.

    How do i access the controlbox menu itself to disable "move" ?

  4. #4

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Re: Disable form drag ?

    Yea its in c# , not vb

  6. #6
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Disable form drag ?

    There's also a VB version here.

    Also, you don't need to remove the controlbox completely if you don't want to. You can, of course, but it's not necessary as far as I know.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Re: Disable form drag ?

    Ive found this one m8 , and it works perfect. thanks for your help on this

    http://www.vbforums.com/showthread.p...ontrolbox+menu

  8. #8
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Disable form drag ?

    Paste this into the form you want to prevent the drag on:

    vb.net Code:
    1. Protected Overrides Sub WndProc(ByRef m As Message)
    2.     If (m.Msg = &H112) AndAlso (m.WParam.ToInt32() = &HF010) Then
    3.         Return
    4.     End If
    5.     If (m.Msg = &HA1) AndAlso (m.WParam.ToInt32() = &H2) Then
    6.         Return
    7.     End If
    8.     MyBase.WndProc(m)
    9. End Sub

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Re: Disable form drag ?

    Quote Originally Posted by ForumAccount View Post
    Paste this into the form you want to prevent the drag on:

    vb.net Code:
    1. Protected Overrides Sub WndProc(ByRef m As Message)
    2.     If (m.Msg = &H112) AndAlso (m.WParam.ToInt32() = &HF010) Then
    3.         Return
    4.     End If
    5.     If (m.Msg = &HA1) AndAlso (m.WParam.ToInt32() = &H2) Then
    6.         Return
    7.     End If
    8.     MyBase.WndProc(m)
    9. End Sub

    Yes thats what im using , thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width