Icek
07-29-2003, 02:53 PM
How to move an Image (or a PictureBox) over a Form and see the image, not only its surrounding frame, during the move phase. Basically, my code looks as follows:
Private Xi As Single
Private Yi As Single
Private Sub Card_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Card(Index).Drag vbBeginDrag
Xi = X
Yi = Y
End If
End Sub
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X - Xi, Y - Yi
End Sub
Private Sub Card_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Source.Move Source.Left + X - Xi, Source.Top + Y - Yi
End Sub
The 'Card' is an Image (or a PictureBox) located in a control array. The code works fine, but I can't see the card face while I'm moving it.
Private Xi As Single
Private Yi As Single
Private Sub Card_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Card(Index).Drag vbBeginDrag
Xi = X
Yi = Y
End If
End Sub
Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
Source.Move X - Xi, Y - Yi
End Sub
Private Sub Card_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Source.Move Source.Left + X - Xi, Source.Top + Y - Yi
End Sub
The 'Card' is an Image (or a PictureBox) located in a control array. The code works fine, but I can't see the card face while I'm moving it.