469,946 Members | 1,344 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Snap Control to grid

Hi,

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

Nov 25 '06 #1
1 2155
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.
--
Dennis in Houston
"Marc" wrote:
Hi,

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

Nov 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Norm | last post: by
2 posts views Thread by Rhonda | last post: by
1 post views Thread by Rob Richardson | last post: by
2 posts views Thread by SStory | last post: by
1 post views Thread by Sam | last post: by
1 post views Thread by Marc Gravell | last post: by
4 posts views Thread by MangroveRoot | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.