Dragging problem - need advice please
I have spent ages trying to make it so that in my card game, when I click on a card and start to drag it the card tags along too:
Code:
Public tempX As Single
Public tempY As Single
Private Sub Form_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
Source.Move X - tempX, Y - tempY
End Sub
Private Sub Card_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lRetVal As Long
lRetVal = ShowCursor(False)
tempX = X
tempY = Y
End Sub
Private Sub Card_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Source.Left = Source.Left + X - tempX
Source.Top = Source.Top + Y - tempY
End Sub
This moves very slowly. I have also tried setting the drag icon as an extracted icon from the card, but they look awful as they are v.small.
Please help
Richard Charlton