You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 85115c9
Browse filesBrowse the repository at this point in the historyBrowse files
helpviewer_keywords: ["resource editors [C++], Dialog editor", "editors, dialog boxes", "Dialog editor", "dialog boxes [C++], editing", "controls [C++], showing or hiding Dialog editor toolbar", "toolbars [C++], showing", "toolbars [C++], hiding", "Dialog Editor [C++], showing or hiding toolbar", "events [C++], viewing for controls", "Windows messages [C++], controls", "messages [C++], viewing for dialog boxes", "Dialog Editor [C++], accessing code", "code [C++], switching from Dialog Editor", "controls [C++], jumping to code", "Dialog Editor [C++], switching between controls and code", "Dialog Editor [C++], shortcut keys"]
6
6
ms.assetid: d94884ef-2cca-49d8-9b58-775f34848134
7
7
---
8
8
# Dialog Editor (C++)
@@ -23,32 +23,95 @@ Starting with Visual Studio 2015, you can use the dialog editor to define dynami
23
23
24
24
-[Creating a Dialog Box that Users Can't Exit at Run Time](../windows/creating-a-dialog-box-that-users-cannot-exit.md)
25
25
26
-
-[Showing or Hiding the Dialog Editor Toolbar](../windows/showing-or-hiding-the-dialog-editor-toolbar.md)
27
-
28
-
-[Switching Between the Dialog Editor and Code](../windows/switching-between-dialog-box-controls-and-code.md)
29
-
30
26
-[Controls in Dialog Boxes](../windows/controls-in-dialog-boxes.md)
31
27
32
28
-[Adding Event Handlers for Dialog Box Controls](../windows/adding-event-handlers-for-dialog-box-controls.md)
33
29
34
30
-[Testing a Dialog Box](../windows/testing-a-dialog-box.md)
35
31
36
-
-[Accelerator Keys for the Dialog Editor](../windows/accelerator-keys-for-the-dialog-editor.md)
37
-
38
32
-[Troubleshooting the Dialog Editor](../windows/troubleshooting-the-dialog-editor.md)
39
33
40
34
> [!TIP]
41
35
> While using the **Dialog** editor, in many instances, you can click the right mouse button to display a shortcut menu of frequently used commands.
42
36
43
-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
37
+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
38
+
39
+
## Dialog Editor Toolbar
40
+
41
+
When you open the **Dialog** editor in a C++ project, the **Dialog Editor** toolbar automatically appears at the top of your solution.
||Test Dialog||Across|
46
+
||Align Lefts||Down|
47
+
||Align Rights||Make Same Width|
48
+
||Align Tops||Make Same Height|
49
+
||Align Bottoms||Make Same Size|
The **Dialog Editor** toolbar contains buttons for arranging the layout of controls on the dialog box, for example size and alignment. **Dialog Editor** toolbar buttons correspond to commands on the **Format** menu.
54
+
55
+
When you are in the **Dialog** editor, you can toggle the display of the **Dialog Editor** toolbar by selecting it from the list of available toolbars and windows.
56
+
57
+
- To show or hide the dialog editor toolbar, on the **View** menu, select **Toolbars**, then choose **Dialog Editor** from the submenu.
58
+
59
+
> [!NOTE]
60
+
> The **Dialog Editor** toolbar is displayed by default when you open a dialog box resource in the Dialog editor; however, if you explicitly close the toolbar, you will need to invoke it the next time you open a dialog box resource.
61
+
62
+
## Switch Between Dialog Box Controls and Code
63
+
64
+
In MFC applications, you can double-click on dialog box controls to jump to their handler code or to quickly create stub handler functions.
65
+
66
+
With a control selected, click the **ControlEvents** button or the **Messages** button in the [Properties window](/visualstudio/ide/reference/properties-window) to view a complete list of Windows messages and events available for the selected item. Choose from the list to create or edit handler functions.
67
+
68
+
- To jump to code from the dialog editor, double-click on a control within the dialog box to jump to the declaration for its most-recently implemented message handling function. (For ATL-based dialog classes, you always jump to the constructor definition.)
69
+
70
+
- To view events for a control, with a control selected, choose the **ControlEvents** button in the [Properties window](/visualstudio/ide/reference/properties-window).
71
+
72
+
> [!NOTE]
73
+
> Choosing the **ControlEvents** button when the *dialog box* has focus exposes a list of all the controls in the dialog box, which you can then expand to edit the events for the individual controls.
74
+
75
+
When a single control has focus in the dialog box, you can right-click it and select **Add Event Handler** from the shortcut menu. This enables you to specify the class to which the handler is added. For more information, see [Adding an Event Handler](../ide/adding-an-event-handler-visual-cpp.md).
76
+
77
+
- To view messages for a dialog box, with the dialog box selected, choose the **Messages** button in the [Properties window](/visualstudio/ide/reference/properties-window).
78
+
79
+
## Accelerator Keys
80
+
81
+
Below are the default accelerator keys for the Dialog editor commands. To change shortcut keys, select **Options** on the **Tools** menu, then choose **Keyboard** under the **Environment** folder. For more information, see [Identifying and Customizing Keyboard Shortcuts](/visualstudio/ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio).
82
+
83
+
> [!NOTE]
84
+
> The options available in dialog boxes, and the names and locations of menu commands you see, might differ from what is 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 [Personalize the Visual Studio IDE](/visualstudio/ide/personalizing-the-visual-studio-ide).
85
+
86
+
|Command|Keys|Description|
87
+
|-------------|----------|-----------------|
88
+
|Format.AlignBottoms|**Ctrl** + **Shift** + **Down Arrow**|Aligns the bottom edges of the selected controls with the dominant control|
89
+
|Format.AlignCenters|**Shift** + **F9**|Aligns the vertical centers of the selected controls with the dominant control|
90
+
|Format.AlignLefts|**Ctrl** + **Shift** + **Left Arrow**|Aligns the left edges of the selected controls with the dominant control|
91
+
|Format.AlignMiddles|**F9**|Aligns the horizontal centers of the selected controls with the dominant control|
92
+
|Format.AlignRights|**Ctrl** + **Shift** + **Right Arrow**|Aligns the right edges of the selected controls with the dominant control|
93
+
|Format.AlignTops|**Ctrl** + **Shift** + **Up Arrow**|Aligns the top edges of the selected controls with the dominant control|
94
+
|Format.ButtonBottom|**Ctrl** + **B**|Places the selected buttons along the bottom-center of the dialog box|
95
+
|Format.ButtonRight|**Ctrl** + **R**|Places the selected buttons in the top-right corner of the dialog box|
96
+
|Format.CenterHorizontal|**Ctrl** + **Shift** + **F9**|Centers the controls horizontally within the dialog box|
97
+
|Format.CenterVertical|**Ctrl** + **F9**|Centers the controls vertically within the dialog box|
98
+
|Format.CheckMnemonics|**Ctrl** + **M**|Checks uniqueness of mnemonics|
99
+
|Format.SizeToContent|**Shift** + **F7**|Resizes the selected control(s) to fit the caption text|
100
+
|Format.SpaceAcross|**Alt** + **Left Arrow**|Evenly spaces the selected controls horizontally|
101
+
|Format.SpaceDown|**Alt** + **Down Arrow**|Evenly spaces the selected controls vertically|
102
+
|Format.TabOrder|**Ctrl** + **D**|Sets the order of controls within the dialog|
103
+
|Format.TestDialog|**Ctrl** + **T**|Runs the dialog box to test appearance and behavior|
104
+
|Format.ToggleGuides|**Ctrl** + **G**|Cycles between no grid, guidelines, and grid for dialog editing|
0 commit comments