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 for fine-tuning, so changing this to something such as 4 × 4 might be more appropriate.

Both SnapToGrid and SnapLines are aids for designing user interfaces using the mouse. Once the control has been roughly positioned, you can use the keyboard to fine-tune control positions by "nudging" the control with the arrow keys.

ShowGrid will display a network of dots on your form's design surface when you're in SnapToGrid mode so you can more easily see where the controls will be positioned when you move them. Finally, setting the SnapToGrid property to False will deactivate the layout aids for SnapToGrid mode and result in pure free-form form design.

While you're looking at this page of options, you may want to change the Automatically Open Smart Tags value to False. The default setting of True will pop open the smart tag task list associated with any control you add to the form, which can be distracting during your initial form design phase. Smart tags are discussed later in this chapter.

The other page of preferences that you can customize for the Windows Forms Designer is the Data UI Customization section. This will be discussed in Chapter 24.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.137.7