views:

283

answers:

2

Using Visual Studio 2008 WinForm designer, I have a container (form, panel, groupbox, whatever) and some controls in it.

The container is set to not automatically resize or dock in any way. When placing a control in the container I can use the snaplines to help in positioning the control.

However, the snaplines does not appear when I resize the container to the edge of the contained controls...

Is there a simple way to have the designer show me the snaplines of the contained controls when resizing the container?

A: 

The designer will only show the snap lines when moving a child control within a container. You can demonstrate it by moving a GroupBox around a Form and see that it shows snap lines when the GroupBox gets close to the edge of the Form, but if you were to resize the Form you won't see the snap lines appear.

If you're just looking to get all of the controls to line up in a uniform fashion, I'd suggest switching to SnapToGrid mode and using the grid lines to align your controls. You can set the SnapToGrid mode by going to Tools->Options->Windows Forms Designer->LayoutMode. Open your designer and you should see the grid appear, after that you can line your controls up with the grid.

Jacob Ewald
Thank you for replying however I don't want to align the controls. I want to have the same spacing around the inside of a container and I can't have that for the bottom area without resizing the controls...
Stecy
A: 

After setting the layout of the form, you can also set anchoring property to all child controls appropriately, to right and bottom (or top and left), depending on the resizing you are making. Anchor property will hold child controls to same distance from the edges of the container (parent control).

ZokiManas
Sure, I could but my problem is having the bottom/right distance of the inner controls show some snap lines when I resize the container.
Stecy