Поделиться через


Windows Forms Designer

Allows you to add controls to a form, arrange them, and write code for their events. Using the designer you can:

  • Add components, data controls, or Windows-based controls to a form.

  • Double-click the form in the designer and write code in the Load event for that form, or double-click a control on the form and write code for the control's default event.

  • Edit a control's Text property by selecting the control and typing a name.

  • Adjust the placement of the selected control by moving it with the mouse or the ARROW keys. Similarly, adjust the placement more precisely using the CTRL and ARROW keys. Finally, adjust the size of the control by using the SHIFT and ARROW keys. For information about adjusting the placement of multiple controls at once, see How to: Align Multiple Controls on Windows Forms.

  • Select multiple controls by using either SHIFT+click or CTRL+click. Using SHIFT+click, the first control selected is the dominant control when aligning or manipulating the size. Using CTRL+click, the last control selected is dominant, so the dominant control changes with every new control added. Alternatively, you can select a number of controls by clicking the form and dragging a selection rectangle around the controls that you want to select.

The Windows Forms Designer provides a rapid development solution for creating Windows-based applications. It is the locus of visual, client-based forms design. Controls may be dragged or drawn onto its surface from the Toolbox.

The following list shows the Toolbox tabs available to the Windows Forms Designer.

  • All Windows Forms

  • Common Controls

  • Containers

  • Menus & Toolbars

  • Data

  • Components

  • Printing

  • Dialogs

  • Crystal Reports

  • General

Non-visual components added to the Windows Forms Designer are placed on the Component Tray, located below the design surface, so that they are easily accessible without cluttering the visual design space. For more information on working with components such as these, see How to: Add Controls Without a User Interface to Windows Forms.

Additionally, by right-clicking the Windows Forms Designer, you get a menu that allows you to switch to the Code Editor, lock the controls to the form, or see the properties of the form. For more information on locking controls to the form, see How to: Lock Controls to Windows Forms.

Important   You should use the Windows Forms Designer to make changes in a form's .resx file, rather than using the Resource Editor. If you attempt to edit a form-based .resx file, you will receive a warning that changes made by you in the Resource Editor may be lost. This is because the Windows Forms Designer generates the .resx file.

In This Section

See Also

Tasks

Walkthrough: Getting Started with the Windows Forms Designer

How to: Set Grid Options for All Windows Forms

Reference

Toolbox

Properties Window

Code and Text Editor

General, Windows Forms Designer, Options Dialog Box

Other Resources

Windows Forms