I have this method:
it works perfects, it alows the user to click and drag a form to move it, however i was looking to see if I can drag using the scrollwheel mousedown event (click and drag with scrollwheel)
i have tried changing the if statement to this:
but it doesnt work. should I not be using mousedown event for this?
VB.NET:
Private Sub formdrag(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gro1.MouseDown
If e.Button = MouseButtons.Left Then
gro1.Capture = False 'groupbox in form
Me.Cursor = Cursors.SizeAll
Const WM_NCLBUTTONDOWN As Integer = &HA1S
Const HTCAPTION As Integer = 2
Dim msg As Message = _
Message.Create(Me.Handle, WM_NCLBUTTONDOWN, _
New IntPtr(HTCAPTION), IntPtr.Zero)
Me.DefWndProc(msg)
End If
Me.Cursor = Cursors.Default
End Sub
it works perfects, it alows the user to click and drag a form to move it, however i was looking to see if I can drag using the scrollwheel mousedown event (click and drag with scrollwheel)
i have tried changing the if statement to this:
VB.NET:
If e.Button = MouseButtons.middle Then