Private Sub Command1_MouseDown(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
xDown = X
yDown = Y
End Sub
Private Sub Command1_MouseMove(Button As Integer, Shift As _
Integer, X As Single, Y As Single)
If Button <> vbRightButton Then Exit Sub
MoveCtl Command1, X, Y
End Sub
Private Sub MoveCtl(ctl As Object, X As Single, Y As Single)
Dim newLeft As Single
Dim newTop As Single
newLeft = ctl.Left + X - xDown
newTop = ctl.Top + Y - yDown
ctl.Move newLeft, newTop
End Sub
|