-
I can't believe I can't do this! Any help? I take a picture box and set dragmode to automatic but can't get my Picbox.cursor-position unless I right click! I want to left click and set X to OldX and Y to OldY. I need this to smoothly drop it in the DragDrop sub using:
source.move (X - OldX),(Y - OldY)
Please help!
-
I'm bringing this to the top as I was quite late posting. Thanks, hope you all can help.
A friend of mine has just informed me he is having similiar problems with left click on drag of treeview nodes.I really hope you can help us.
Thanks,
Joey O.
-
C'mon guys, do you just answer the easy ones? This is a problem you will eventually run into.Please help me out.
-
If you set the DragMode to Manual, it might be easier.
Code:
Dim OldX As Single
Dim OldY As Single
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Left = X - OldX
Source.Top = Y - OldY
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
OldX = X
OldY = Y
Picture1.Drag
End If
End Sub