I have a frame that contains several buttons, textboxes etc. At the top is a label (Label2). When the user clicks down on Label2 and moves the mouse, the Frame will hopefully follow the mouse until the user releases the button. I have this:
[tt]
Dim MoveControl as Boolean
Private Sub Label2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveControl = True
CurrentX = X
CurrentY = Y
End Sub
Private Sub Label2_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If MoveControl Then
Select Case Index
Case 3:
frameForm.Top = Y
frameForm.Left = X
End Select
End If
End Sub
Private Sub Label2_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveControl = False
End Sub
[/tt]
It doesn't work though. Any ideas?
[tt]
Dim MoveControl as Boolean
Private Sub Label2_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveControl = True
CurrentX = X
CurrentY = Y
End Sub
Private Sub Label2_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If MoveControl Then
Select Case Index
Case 3:
frameForm.Top = Y
frameForm.Left = X
End Select
End If
End Sub
Private Sub Label2_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveControl = False
End Sub
[/tt]
It doesn't work though. Any ideas?