moving on userform

H

Harald Staff

Hi Zygan

userform code:

Option Explicit

Dim X1 As Long, Y1 As Long

Private Sub Image1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
X1 = X
Y1 = Y
End Sub

Private Sub Image1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 Then
Image1.Left = Image1.Left + X - X1
Image1.Top = Image1.Top + Y - Y1
End If
End Sub

HTH. Best wishes Harald
 
Top