-
Hi,
I have a program where I want to move the Image on the form, for example if the image is to large for the screen i want to click on the image and move the image with the mouse instead of having scroolbars. Do anyone know how it's done. I have made it with POINTAPI but the image updates so slow and it flickers. Do someone know of a better way?
-
Code:
Dim OldX As Single
Dim OldY As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
OldX = X
OldY = Y
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then Picture1.MOVE Picture1.Left + (X - OldX), Picture1.Top + (Y - OldY)
End Sub
-
make sure auto-resize is set to true, and that should work.