|
1 | 1 | ---
|
2 |
| -title: Design Windows Forms applications |
3 |
| -description: 'Explore Windows Forms Designer in Visual Studio for rapid application development: arrange controls, set margins and padding, adjust layout, size, and display.' |
4 |
| -ms.date: 08/09/2019 |
| 2 | +title: Design Windows Forms Applications |
| 3 | +description: Explore Windows Forms Designer in Visual Studio for rapid application development. Arrange controls, set margins and padding, and adjust the layout, size, and display of forms. |
| 4 | +ms.date: 06/24/2025 |
5 | 5 | ms.topic: overview
|
6 | 6 | helpviewer_keywords:
|
7 | 7 | - Windows Forms Designer
|
8 | 8 | author: ghogen
|
9 | 9 | ms.author: ghogen
|
10 | 10 | manager: mijacobs
|
11 | 11 | ms.subservice: ui-designers
|
| 12 | +#customer intent: As a developer, I want to use Windows Forms Designer in Visual Studio, so I can arrange controls, set margins and padding, and adjust the layout, size, and display of forms. |
12 | 13 | ---
|
13 |
| -# Windows Forms Designer overview |
| 14 | +# What is Windows Forms Designer? |
14 | 15 |
|
15 |
| -Windows Forms Designer in Visual Studio provides a rapid development solution for creating Windows Forms-based applications. Windows Forms Designer lets you easily add controls to a form, arrange them, and write code for their events. For more information about Windows Forms, see [Windows Forms overview](/dotnet/framework/winforms/windows-forms-overview). |
| 16 | +Windows Forms Designer in Visual Studio provides a rapid development solution for creating Windows Forms-based applications. Windows Forms Designer lets you easily add controls to a form, arrange them, and write code for their events. For more information about Windows Forms, see [Windows Forms overview](/dotnet/desktop/winforms/overview/). |
16 | 17 |
|
17 |
| -## Functionality |
| 18 | +## Explore the functionality |
18 | 19 |
|
19 |
| -Using the designer you can: |
| 20 | +Here are some of the tasks you can complete with Windows Forms Designer: |
20 | 21 |
|
21 | 22 | - Add components, data controls, or Windows-based controls to a form.
|
22 | 23 |
|
23 |
| -- 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. |
| 24 | +- Double-click the form in the designer and write code in the `Load` event for that form. Double-click a control on the form and write code for the control's default event. |
24 | 25 |
|
25 |
| -- Edit a control's Text property by selecting the control and typing a name. |
| 26 | +- Edit a control's **Text** property by selecting the control and entering a name. |
26 | 27 |
|
27 |
| -- 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. |
| 28 | +- Adjust the placement of the selected control by moving it with the mouse or the arrow keys (**Up**, **Down**, **Left**, **Right**). Adjust the placement more precisely by selecting **Ctrl** + the arrow keys. Adjust the size of the control by selecting **Shift** + the arrow keys. |
28 | 29 |
|
29 |
| -- Select multiple controls by selecting either **Shift** or **Ctrl** while you click. When using **Shift**+click, the first control selected is the dominant control when aligning or manipulating size. When using **Ctrl**+click, the last control selected is dominant, so the dominant control changes with every new control added. Alternatively, you can select multiple controls by dragging a selection rectangle around the controls that you want to select. |
| 30 | +- Access multiple form controls simultaneously with **Shift** or **Ctrl** followed by the control shortcut. When you select **Shift** + \<Control shortcut>, the first control you select is the dominant control as you align windows and adjust the size. When you select **Ctrl** + \<Control shortcut>, the last control you select is dominant. This approach allows the dominant control to change to the new control each time you add a control. Another approach is to select multiple controls by dragging a selection rectangle around the controls that you want to select. |
30 | 31 |
|
31 |
| -> [!NOTE] |
32 |
| -> Use Windows Forms Designer, and not the Resource Editor, to make changes to a form's resource (*.resx*) file. If you edit a form-based .resx file, you'll see a warning that changes you make in the Resource Editor may be lost. This is because the Windows Forms Designer generates the .resx file. |
| 32 | +## Review caution scenarios |
33 | 33 |
|
34 |
| -> [!CAUTION] |
35 |
| -> Windows Forms Designer executes application code when displaying controls or forms on the design surface. Only open projects from [trusted locations](..\ide\reference\trust-settings.md). |
| 34 | +When you work with Windows Forms Designer in Visual Studio, exercise caution in the following scenarios: |
36 | 35 |
|
37 |
| -> [!CAUTION] |
38 |
| -> Resources in `.resx` files may be serialized using `BinaryFormatter`, which is [not secure](/dotnet/standard/serialization/binaryformatter-security-guide). Only use Windows Forms Designer to work with forms and controls that you trust. |
| 36 | +- Windows Forms Designer executes application code when displaying controls or forms on the design surface. To ensure executed application code is safe for your system, open projects only from [files and folders configured with trust settings](..\ide\reference\trust-settings.md). |
39 | 37 |
|
40 |
| -## See also |
| 38 | +- Changes to the resource (*.resx*) file for a form should be made with Windows Forms Designer only and not the Resource Editor. If you edit a form-based *.resx* file, changes made outside the designer can be lost. |
| 39 | + |
| 40 | +- Resources in a _.resx_ file can be serialized by using the [BinaryFormatter](/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter) type. However, this type presents deserialization risks. The type is [insecure and not trustworthy](/dotnet/standard/serialization/binaryformatter-security-guide). Use Windows Forms Designer to work only with forms and controls that you trust. |
| 41 | + |
| 42 | +## Related content |
41 | 43 |
|
42 | 44 | - [Windows Forms overview](/dotnet/framework/winforms/windows-forms-overview)
|
43 | 45 | - [Windows Forms controls](/dotnet/framework/winforms/controls/)
|
44 |
| -- [User input in Windows Forms](/dotnet/framework/winforms/user-input-in-windows-forms) |
45 |
| -- [Data binding in Windows Forms](/dotnet/framework/winforms/windows-forms-data-binding) |
46 |
| -- [Enhance Windows Forms apps](/dotnet/framework/winforms/advanced/) |
47 |
| -- [System.Windows.Forms API reference](/dotnet/api/system.windows.forms) |
| 46 | +- [User input in Windows Forms](/dotnet/framework/winforms/user-input-in-windows-forms) |
0 commit comments