View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default moving on userform

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

"Zygan" skrev i melding
...

how do i create an image that i can move on a userform e,g if i was
playing chess ?


--
Zygan
------------------------------------------------------------------------
Zygan's Profile:

http://www.excelforum.com/member.php...o&userid=34423
View this thread: http://www.excelforum.com/showthread...hreadid=565461