Dim NowX As Single, NowY As Single
Dim OldX As Single, OldY As Single
Dim XTwip As Single, YTwip As Single
Private Sub Form_Load()
Me.ScaleMode = 1
DragFlag = False
XTwip = Screen.TwipsPerPixelX
YTwip = Screen.TwipsPerPixelY
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
If Button = 1 And DragFlag = False Then
OldX = X * XTwip: OldY = Y * YTwip
NowX = Picture1.Left: NowY = Picture1.Top
DragFlag = True
'Me.MousePointer = 15
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
DragFlag = False
'Me.MousePointer = 0
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
If DragFlag = True Then
Picture1.Move NowX + (X * XTwip - OldX), NowY + (Y * YTwip - OldY)
NowX = Picture1.Left: NowY = Picture1.Top
End If
End Sub