This documentation is archived and is not being maintained.

How to: Arrange Controls with Snaplines and the Grid in Windows Forms 

Using the layout features of Visual Studio, you can precisely direct where controls are placed on a form. Controls added to a form or moved on a form can be automatically aligned to the rows and columns of the Windows Forms Designer's grid, or you can align controls by using the snaplines feature.


The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To snap all controls to the grid

  • Select the SnapToGrid layout mode in the Windows Forms Designer Options dialog box.

    For more information, see General, Windows Forms Designer, Options Dialog Box. All controls now align themselves along the points on the grid.

    You can snap individual controls to the grid by locking them in place. However, while they are locked, they cannot be moved or resized. For more information about locking controls, see How to: Lock Controls to Windows Forms.

To align controls using snaplines

See Also