The label appears when a particular cell is selected in a datagridview using the mousedown event.
What I would like to do is commence the dragging as soon as the cell is mousedowned(?) so I don't have to release the button and then click the label to drag it
Private Sub lblTransfer_MouseDown(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.MouseEventArgs) Handles lblTransfer.MouseDown
mouseButtonIsDown = True
movingPatient = True
End Sub
Private Sub lblTransfer_MouseMove(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.MouseEventArgs) Handles lblTransfer.MouseMove
Dim Button As Short = eventArgs.Button \ &H100000
'DRAG THE label AROUND ON THE SCREEN
'WHILE THE LEFT BUTTON IS DOWN
If Button = 1 Then
lblTransfer.Left = lblTransfer.Left + (eventArgs.X + 8)
lblTransfer.Top = lblTransfer.Top + (eventArgs.Y + 15)
End If
End Sub
I tried calling these events from the cell mousedown events and the labels events do get called but the label dragging does not start.
Any ideas?

New Topic/Question
Reply




MultiQuote




|