|
-
May 24th, 2002, 01:25 PM
#1
Thread Starter
Frenzied Member
drag & drop
I have an image inside one picture box among an array of picture boxes.
I want to be able to drag this image from one picture box to another and 'drop' the image onto the new location.
This is what I have so far...
VB Code:
Private Sub Picture1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Source.Move (X - DragX), (Y - DragY)
End Sub
The event fires at the right time, but the image always remains in the original picture box. It DOES move, but only slightly, and I'm positive we would have to modify the parent property of the image control somehow. When I tried
VB Code:
Source.Parent = Picture1(Index)
it generated errors.
Is there another way to do this?
-
May 24th, 2002, 01:31 PM
#2
VB Code:
Private Sub Picture1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Picture1.Picture = Picture2.Picture
End Sub
-
May 24th, 2002, 01:34 PM
#3
Thread Starter
Frenzied Member
I would really like to move the actual image box there rather than just copy pictures since I have information stored in the tag property
-
May 24th, 2002, 01:35 PM
#4
Thread Starter
Frenzied Member
also Picture1 is a control array.
-
May 24th, 2002, 01:40 PM
#5
You can copy the Tag property too..
But as for your request, you want to remove the image from the original image control after you drop it?
VB Code:
Private Sub Picture1_DragDrop(Index As Integer, Source As Control, X As Single, Y As Single)
Set Source.Picture = Nothing
End Sub
-
May 24th, 2002, 01:46 PM
#6
Thread Starter
Frenzied Member
Ok thanks i figured it out
-
May 24th, 2002, 01:51 PM
#7
Thread Starter
Frenzied Member
How do you make the image visible while it is being dragged?
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
|