Skip to content

Commit d6824c5

Browse files
authored
Merge pull request MicrosoftDocs#1685 from msebolt/resource-file-consolidation-pr5
resource file consolidation pr5
2 parents a86a2ae + b18151f commit d6824c5

6 files changed

Lines changed: 113 additions & 159 deletions

‎.openpublishing.redirection.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7345,6 +7345,21 @@
73457345
"redirect_url": "/cpp/windows/binary-editor",
73467346
"redirect_document_id": false
73477347
},
7348+
{
7349+
"source_path": "docs/windows/adding-multiple-controls.md",
7350+
"redirect_url": "/cpp/windows/adding-a-control-to-a-dialog-box",
7351+
"redirect_document_id": false
7352+
},
7353+
{
7354+
"source_path": "docs/windows/dialog-editor-tab-toolbox.md",
7355+
"redirect_url": "/cpp/windows/adding-a-control-to-a-dialog-box",
7356+
"redirect_document_id": false
7357+
},
7358+
{
7359+
"source_path": "docs/windows/sizing-a-control-while-you-add-it.md",
7360+
"redirect_url": "/cpp/windows/adding-a-control-to-a-dialog-box",
7361+
"redirect_document_id": false
7362+
},
73487363
{
73497364
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
73507365
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@
6767
##### [Controls in Dialog Boxes](controls-in-dialog-boxes.md)
6868
###### [Adding, Editing, or Deleting Controls](adding-editing-or-deleting-controls.md)
6969
####### [Adding a Control to a Dialog Box](adding-a-control-to-a-dialog-box.md)
70-
######## [Dialog Editor Tab, Toolbox](dialog-editor-tab-toolbox.md)
71-
####### [Adding Multiple Controls](adding-multiple-controls.md)
72-
####### [Sizing a Control While You Add It](sizing-a-control-while-you-add-it.md)
7370
####### [Editing Control Properties](editing-control-properties.md)
7471
####### [Deleting a Control](deleting-a-control.md)
7572
####### [Viewing and Adding ActiveX Controls to a Dialog Box](viewing-and-adding-activex-controls-to-a-dialog-box.md)

‎docs/windows/adding-a-control-to-a-dialog-box.md‎

Lines changed: 98 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,114 @@
22
title: "Adding a Control to a Dialog Box (C++)"
33
ms.date: "11/04/2016"
44
f1_keywords: ["vc.editors.dialog.dialog"]
5-
helpviewer_keywords: ["dialog boxes [C++], adding controls to"]
5+
helpviewer_keywords: ["dialog boxes [C++], adding controls to", "Toolbox [C++], Dialog Editor tab", "controls [C++], types", "syslink controls in dialog boxes", "custom controls [C++], dialog boxes", "controls [C++], standard", "Dialog Editor [C++], creating controls", "controls [C++], adding to dialog boxes", "controls [C++], adding multiple", "dialog box controls [C++], size", "controls [C++], sizing"]
66
ms.assetid: b2a26d19-093f-49ca-93da-fef00dfbb381
77
---
88
# Adding a Control to a Dialog Box (C++)
99

10-
### To add a control to a dialog box
10+
The **Dialog Editor** tab appears in the [Toolbox window](/visualstudio/ide/reference/toolbox) when you're working in the **Dialog** editor. To add controls to your new dialog box, drag controls from the **Toolbox** to the dialog box you're creating. You can then move the controls around or change their size and shape.
1111

12-
1. Ensure that the dialog box tabbed window is the current document in the editor frame. If a dialog is not the current document, you won't see the **Dialog Editor Tab** in the **Toolbox**.
12+
The standard controls available in the **Toolbox** are:
1313

14-
2. On the [Dialog Editor Tab](../windows/dialog-editor-tab-toolbox.md) of the [Toolbox Window](/visualstudio/ide/reference/toolbox), select the control you want, then:
14+
- [Button control](../mfc/reference/cbutton-class.md)
1515

16-
- Click the dialog box at the location where you want to place the control. The control appears where you've clicked. For information, see [Adding Multiple Controls](../windows/adding-multiple-controls.md).
16+
- [Check Box control](../mfc/reference/styles-used-by-mfc.md#button-styles)
17+
18+
- [Combo Box control](../mfc/reference/ccombobox-class.md)
19+
20+
- [Edit control](../mfc/reference/cedit-class.md)
21+
22+
- Group box
23+
24+
- [List Box control](../mfc/reference/clistbox-class.md)
25+
26+
- [Radio Button control](../mfc/reference/styles-used-by-mfc.md#button-styles)
27+
28+
- [Static Text control](../mfc/reference/cstatic-class.md)
29+
30+
- [Picture control](../mfc/reference/cpictureholder-class.md)
31+
32+
- [Rich Edit 2.0 control](../mfc/using-cricheditctrl.md)
33+
34+
- [Scroll bar control](../mfc/reference/cscrollbar-class.md)
35+
36+
The [Windows Common Controls](../mfc/controls-mfc.md) available in the **Toolbox** provide increased functionality in your application. They include:
37+
38+
- [Slider control](../mfc/slider-control-styles.md)
39+
40+
- [Spin control](../mfc/using-cspinbuttonctrl.md)
41+
42+
- [Progress control](../mfc/styles-for-the-progress-control.md)
43+
44+
- [Hot Key control](../mfc/using-a-hot-key-control.md)
45+
46+
- [List control](../mfc/list-control-and-list-view.md)
47+
48+
- [Tree control](../mfc/tree-control-styles.md)
49+
50+
- [Tab control](../mfc/tab-controls-and-property-sheets.md)
51+
52+
- [Animation control](../mfc/using-an-animation-control.md)
53+
54+
- [Date Time Picker control](../mfc/creating-the-date-and-time-picker-control.md)
55+
56+
- [Month Calendar control](../mfc/month-calendar-control-examples.md)
57+
58+
- [IP Address control](../mfc/reference/cipaddressctrl-class.md)
59+
60+
- [Extended Combo Box control](../mfc/creating-an-extended-combo-box-control.md)
61+
62+
- [Custom control](custom-controls-in-the-dialog-editor.md)
63+
64+
You can add custom controls to the dialog box by selecting the **Custom Control** icon in the **Toolbox** and dragging it to your dialog box. To add a **Syslink** control, add a custom control, then change the control's **Class** property to **Syslink**. This will cause the properties to refresh and show the **Syslink** control properties. For information on the MFC wrapper class, see [CLinkCtrl](../mfc/reference/clinkctrl-class.md).
65+
66+
You may also [add ActiveX controls to your dialog box](../windows/viewing-and-adding-activex-controls-to-a-dialog-box.md).
67+
68+
You can also customize the **Toolbox** window for easier use. For more information, see [Using the Toolbox](/visualstudio/ide/using-the-toolbox).
69+
70+
For more information on using the **RichEdit 1.0** control with MFC, see [Using the RichEdit 1.0 Control with MFC](../windows/using-the-richedit-1-0-control-with-mfc.md)
71+
72+
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).
73+
74+
## To add a control to a dialog box
75+
76+
1. Ensure that the dialog box tabbed window is the current document in the editor frame. If a dialog isn't the current document, you won't see the **Dialog Editor Tab** in the **Toolbox**.
77+
78+
1. On the **Dialog Editor** tab of the [Toolbox Window](/visualstudio/ide/reference/toolbox), select the control you want, then:
79+
80+
- Select the dialog box at the location where you want to place the control. The control appears where you've selected.
1781

1882
\- or -
1983

20-
- Drag and drop the control from the **Toolbox** window to the location on your dialog box. For more information, see [Sizing a Control While You Add It](../windows/sizing-a-control-while-you-add-it.md).
84+
- Drag and drop the control from the **Toolbox** window to the location on your dialog box.
2185

2286
\- or -
2387

2488
- Double-click the control in the **Toolbox** window (it appears on your dialog box) then reposition the control to the location you prefer.
2589

26-
For information about the types of controls available on the **Toolbox** window, see [Dialog Editor Tab, Toolbox Window](../windows/dialog-editor-tab-toolbox.md).
90+
## To add multiple controls
91+
92+
1. While holding down the **Ctrl** key, select a control in the [Toolbox Window](/visualstudio/ide/reference/toolbox).
93+
94+
1. Release the **Ctrl** key and select the dialog box as many times as you want to add the particular control.
95+
96+
1. Press **Esc** to stop placing controls.
97+
98+
## To size a control while you add it
99+
100+
1. Select a control in the [Toolbox Window](/visualstudio/ide/reference/toolbox).
101+
102+
1. Place your cursor (which appears as cross hairs) where you want the upper-left corner of the new control to be on your dialog box.
103+
104+
1. Select and hold down the mouse button to anchor the upper-left corner of your control on the dialog box, then drag the cursor to the right and down until the control is the size you want.
105+
106+
> [!NOTE]
107+
> You can actually anchor any of the four corners of the control you're drawing. This procedure used the upper-left corner as an example.
108+
109+
1. Release the mouse button. The control settles onto the dialog box in the size you specified.
27110

28-
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).
111+
> [!TIP]
112+
> You can resize the control after dropping it onto the dialog box by moving the sizing handles on the border of the control. For more information, see [Sizing Individual Controls](../windows/sizing-individual-controls.md).
29113
30114
## Requirements
31115

@@ -35,4 +119,9 @@ Win32
35119

36120
[Controls in Dialog Boxes](../windows/controls-in-dialog-boxes.md)<br/>
37121
[Adding Event Handlers for Dialog Box Controls](../windows/adding-event-handlers-for-dialog-box-controls.md)<br/>
38-
[Dialog Box Controls and Variable Types](../ide/dialog-box-controls-and-variable-types.md)
122+
[Dialog Box Controls and Variable Types](../ide/dialog-box-controls-and-variable-types.md)<br/>
123+
[Controls](../mfc/controls-mfc.md)<br/>
124+
[Control Classes](../mfc/control-classes.md)<br/>
125+
[Dialog Box Classes](../mfc/dialog-box-classes.md)<br/>
126+
[Scroll-Bar Styles](../mfc/reference/styles-used-by-mfc.md#scroll-bar-styles)<br/>
127+
[Rich Edit Control Examples](../mfc/rich-edit-control-examples.md)<br/>

‎docs/windows/adding-multiple-controls.md‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎docs/windows/dialog-editor-tab-toolbox.md‎

Lines changed: 0 additions & 85 deletions
This file was deleted.

‎docs/windows/sizing-a-control-while-you-add-it.md‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)