- Joined
- Oct 23, 2004
- Location
- Hillbillyville
Hey.
I want to have a thing where you can drag and drop a picturebox with the mouse, and i want the picture to move with the mouse (so you can see where you are dropping the picture).
This seems like it should be an easy thing, but VB is fighting me the whole way ;- ]
I can't do it based on mousedowns from the form, because if you mousedown on the image, it doesn't count as being on the form. My original idea was for the form to pick up mousedowns and mousemoves, and while it was doing that, change the location of the picturebox. BUT, VB won't let you mousedown THROUGH a picturebox.
Doing it on the picturebox has given me a lot of problems with the referencing.. Because then the mouse coordinates are based inside the picture itself (is there a way to get the absolute coordinates?) Then moving the image gets all screwy.. Because moving the mouse moves the picture which changes the coordinates in a different way so hte picture moves elsewhere... Boo..
I was trying to use a timer to control it, but I don't know how to get the mouse coordinates into the timer..
So.. Anyone have any advice on how to make it so you can drag around a picturebox and have it show you the picturebox moving?
Thanks!
(Using VB.net 2005 :- ] )
I want to have a thing where you can drag and drop a picturebox with the mouse, and i want the picture to move with the mouse (so you can see where you are dropping the picture).
This seems like it should be an easy thing, but VB is fighting me the whole way ;- ]
I can't do it based on mousedowns from the form, because if you mousedown on the image, it doesn't count as being on the form. My original idea was for the form to pick up mousedowns and mousemoves, and while it was doing that, change the location of the picturebox. BUT, VB won't let you mousedown THROUGH a picturebox.
Doing it on the picturebox has given me a lot of problems with the referencing.. Because then the mouse coordinates are based inside the picture itself (is there a way to get the absolute coordinates?) Then moving the image gets all screwy.. Because moving the mouse moves the picture which changes the coordinates in a different way so hte picture moves elsewhere... Boo..
I was trying to use a timer to control it, but I don't know how to get the mouse coordinates into the timer..
So.. Anyone have any advice on how to make it so you can drag around a picturebox and have it show you the picturebox moving?
Thanks!
(Using VB.net 2005 :- ] )