8.2. Form Design Preferences

There are some Visual Studio IDE settings you can modify that will simplify your user interface design phase. In the Options dialog (shown in Figure 8-3) of Visual Studio 2008, two pages of preferences deal with the Windows Forms Designer.

Figure 8.3. Figure 8-3

The main settings that affect your design are the layout settings. By default, Visual Studio 2008 uses a layout mode called SnapLines. Rather than position visible components on the form via an invisible grid, SnapLines helps you position them based on the context of surrounding controls and the form's own borders. You'll see how to use this new mode in a moment, but if you prefer the older style of form design that originated in Visual Basic 6 and was used in the first two versions of Visual Studio .NET, you can change the LayoutMode property to SnapToGrid.

The SnapToGrid layout mode is still used even if the LayoutMode is set to SnapLines. SnapLines becomes active only when you are positioning a control relative to another control. At other times, SnapToGrid will be active and will enable you to position the control on the grid vertex.

The GridSize property is used for positioning and sizing controls on the form. As you move controls around the form, they will snap to specific points based on the values you enter here. Most of the time you'll find a grid of 8 × 8 (the default) too large ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.