'通用中声明
Dim MX As Long, MY As Long
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MX = X
MY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If MX - X <= 0 Then
Me.Left = Me.Left + Abs(MX - X)
Else
Me.Left = Me.Left - Abs(MX - X)
End If
If MY - Y <= 0 Then
Me.Top = Me.Top + Abs(MY - Y)
Else
Me.Top = Me.Top - Abs(MY - Y)
End If
End If
End Sub