Move the form by dragging a control, with only one event...MouseMove
Move the form by dragging a control, with only one event...MouseMove
API Declarations
'You may rename "Label1" to whatever the control is called in the form. It will
'only move the parent form, not others. It only accepts the Left mouse button.
'To test this example, create one label named "Label1" on a form, start the
'program, then drag that label.
Rate Move the form by dragging a control, with only one event...MouseMove
(2(2 Vote))
Dim CurX As Single
Dim CurY As Single
Dim MovX As Single
Dim MovY As Single
If Button = 1 Then
MovX = x - CurX
MovY = y - CurY
Left = Left + MovX
Top = Top + MovY
Else
CurX = x
CurY = y
End If
End Sub
Move the form by dragging a control, with only one event...MouseMove Comments
No comments yet — be the first to post one!
Post a Comment