[SOLVED] Snap to grid

Answered
0
0

Hi!

How can I move a control at runtime (drag and drop), but snap to grid?

Thank you very much,
Ulisses.

  • You must to post comments
Best Answer
0
0

All controls can be moved setting Movable to True.

The snap to grid has to be implemented. You can add that logic to the LocationChanged event. If you add a mixin to set “transition”: “left 150ms, top 150ms” it will also animate the relocation. Additionally, if you make the panels children of a FlowLayoutPanel they will also animate into position when resizing.

  • Ulisses
    Thanks, Luca!
  • You must to post comments
Great Answer
0
0

Attachment

Attachment
  • You must to post comments
0
0

I would love to know if this is possible too! Ideally populating a dashboard full of different controls I can drag around and reorder. Like the azure portals dashboard.

  • Ulisses
    Hi, Mark! See the code I’ve developed. I’m going to improve it, but it’s a start…
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.