-
Feb 27th, 2012, 04:55 AM
#1
Thread Starter
Junior Member
Drag&Drop outside the app doesn't trigger
Hi,
I'm making a game where you can drag & drop (move around) Image controls on the Form (among other things). In the Image MouseMove event I call the Drag event and disable the Image, and in the Form DragDrop event I position the image and re-enable the Image. But, if a user drags the image outside the form, the "No Drop" cursor appears and if the user actually "drops" the image outside, the form's DragDrop event doesn't trigger, thus the Image isn't re-enabled.
I'm using (manual) Drag&Drop, not OLEDrag&Drop. Any suggestions as to how to handle dragging outside? Should I use OLEDragDrop?
Thanks
Last edited by Meehael; Feb 27th, 2012 at 08:55 AM.
-
Feb 27th, 2012, 01:42 PM
#2
Re: Drag&Drop outside the app doesn't trigger
When you say manual drag, what exactly do you mean? Can you show us the code you use to perform the drag operation?
-
Feb 27th, 2012, 01:54 PM
#3
Thread Starter
Junior Member
Re: Drag&Drop outside the app doesn't trigger
Originally Posted by LaVolpe
When you say manual drag, what exactly do you mean? Can you show us the code you use to perform the drag operation?
DragMode is Manual, that's what I meant. I don't have the project with me at the moment, but a piece of drag & drop code should be something like this:
Code:
Private Sub imgClue_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
X1 = X
Y1 = Y
End Sub
Private Sub imgClue_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
imgClue(Index).Drag
imgClue(Index).Enabled = False
End If
End Sub
Private Sub Picture1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)
Source.Left = X - X1 / 15
Source.Top = Y - Y1 / 15
End Sub
Private Sub Picture1_DragDrop(Source As Control, X As Single, Y As Single, State As Integer)
Source.Enabled = True
End Sub
Picture1 is spread across the whole form and ScaleMode is Pixel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|