I am making various card games,
but I have tried to make the card drag along with the mouse by
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
and
Code:
Card.DragIcon = imglist.Listimages(4).ExtractIcon
The first works very slowly, but the drag icon is whatever a standard icon size is.
Could you please help.
Richard CHarlton
I was using another piece of code with dragging.
With your code, how can you tell when the card being dragged is over another card? Also could you please send me the modules which you have referred to.
Thank you very very much
Richard Charlton