draggable controls? (1 Viewer)

AccessKurzo

Dazed and Confused
Local time
Yesterday, 22:30
Joined
Jan 5, 2001
Messages
55
I would like to have a form where the user can place picture box images in any part of the form and have the form save the placement of the boxes.

How could you do this? Where's a good place to start?
 

AccessKurzo

Dazed and Confused
Local time
Yesterday, 22:30
Joined
Jan 5, 2001
Messages
55
thanks wiz,

But I am not looking to drag text from one control to another, I would like to have a picturebox that can be dragged to any part of a screen and then have its location saved.

Think of it like re-arranging furniture, I want them to be able to move a 'couch' control and have the location its moved to saved so that when the form is opened again, it shows the 'couch' in the new location.
 

rockman

Senior Member
Local time
Yesterday, 20:30
Joined
May 29, 2002
Messages
190
You can accomplish this by using the MouseOver event to change the location of the object (picture box) according to the X and Y parameters that are passed to the MouseOver event.

In addition, you can make it more user friendly by using the MouseDown and MouseUp events to "turn on" and "turn off" a global variable that allows your MouseOver code to execute.

Finally, change the screen.mousepointer to an appropriate icon to indicate to your user that they are dragging the object.

Don't forget to check for boundry areas where the object cannot be placed, lest your code crashes for trying to place the object at -33,-24 (as an example).

HTH, Jeff
 

Users who are viewing this thread

Top Bottom