โค๊ด: [Select]
Private XX As Integer
Private YY As Integer
Dim MoveMe As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
MoveMe = True
XX = X
YY = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If MoveMe = True Then
Me.Left = Me.Left + (X - XX)
Me.Top = Me.Top + (Y - YY)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Left = Me.Left + (X - XX)
Me.Top = Me.Top + (Y - YY)
MoveMe = False
End Sub
ยัดลง Form ครับ ...
Credit : IT-DARK.ORG