odiseh
odiseh

Reputation: 26547

C#: How can I move my controls on a win form in windows application freely?

C#: How can I move my controls on a win form in windows application freely?

I do NOT want IDE control the position of my controls for me.

Thank you

Upvotes: 1

Views: 2798

Answers (3)

Julian
Julian

Reputation: 20324

Visual Studio tries to help you align your controls by "snapping" them to an alignment line (e.g. left of another control, right of another control, a short distance from another control or the form edge etc.), so this might be what you experience as not being able to move your controls freely?

If this is the case, you can fine-tune the position by using the arrows on your keyboard. Move the control approximately where you want it with your mouse, and then use the keyboard for the final adjustment.

Upvotes: 3

this. __curious_geek
this. __curious_geek

Reputation: 43217

it seems u r looking for similar implementation as in visual studio forms designer. system.design assembly defines DesignSurface that can certainly do what u need. check this out.

http://www.codeproject.com/KB/cs/DesignSurfaceExtended.aspx

Upvotes: 0

Anemoia
Anemoia

Reputation: 8116

Do you mean at runtime dragging the controls around?

If so: you have to check when the mouse is clicked, find the control, and move it around on drag as long as the button is clicked.

Upvotes: 0

Related Questions