Snap Control to grid

M

Marc

Hi,

Anyone know how I can have my drag and drop form controls 'snap' to a
grid like in windows desktop?
 
G

Guest

Divide your window (or whatever you are dragging the controls to) up into a
grid based on the size of grid elements and store these in an array (either
two dimensional or use a structure). When the user drops the control onto
your window, determine the x,y nearest in your grid to where the control is
dropped then change the location of the control to that x,y.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Snap to shape 4
Snap to grid functionality??? 2
freeform snap to grid 1
More snap-to-grid wierdness 1
Snap to Grid - where did it go??? 3
snap tp grid not working 2
Snap to Grid 1
Snap to guide 1

Top