Skip to content

Commit b488462

Browse files
authored
Merge pull request MicrosoftDocs#1688 from MicrosoftDocs/master
1/30/2019 AM Publish
2 parents 5beace7 + 65be4d9 commit b488462

17 files changed

Lines changed: 317 additions & 483 deletions

‎.openpublishing.redirection.json‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7325,6 +7325,61 @@
73257325
"redirect_url": "/cpp/windows/predefined-accelerator-keys",
73267326
"redirect_document_id": false
73277327
},
7328+
{
7329+
"source_path": "docs/windows/creating-a-new-custom-or-data-resource.md",
7330+
"redirect_url": "/cpp/windows/binary-editor",
7331+
"redirect_document_id": false
7332+
},
7333+
{
7334+
"source_path": "docs/windows/editing-binary-data.md",
7335+
"redirect_url": "/cpp/windows/binary-editor",
7336+
"redirect_document_id": false
7337+
},
7338+
{
7339+
"source_path": "docs/windows/finding-binary-data.md",
7340+
"redirect_url": "/cpp/windows/binary-editor",
7341+
"redirect_document_id": false
7342+
},
7343+
{
7344+
"source_path": "docs/windows/opening-a-resource-for-binary-editing.md",
7345+
"redirect_url": "/cpp/windows/binary-editor",
7346+
"redirect_document_id": false
7347+
},
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+
},
7363+
{
7364+
"source_path": "docs/windows/editing-properties-for-an-activex-control.md",
7365+
"redirect_url": "/cpp/windows/viewing-and-adding-activex-controls-to-a-dialog-box",
7366+
"redirect_document_id": false
7367+
},
7368+
{
7369+
"source_path": "docs/windows/insert-activex-control-dialog-box.md",
7370+
"redirect_url": "/cpp/windows/viewing-and-adding-activex-controls-to-a-dialog-box",
7371+
"redirect_document_id": false
7372+
},
7373+
{
7374+
"source_path": "docs/windows/selecting-multiple-controls.md",
7375+
"redirect_url": "/cpp/windows/selecting-controls",
7376+
"redirect_document_id": false
7377+
},
7378+
{
7379+
"source_path": "docs/windows/specifying-the-dominant-control.md",
7380+
"redirect_url": "/cpp/windows/selecting-controls",
7381+
"redirect_document_id": false
7382+
},
73287383
{
73297384
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
73307385
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@
5959
##### [Editing Accelerator Tables](editing-accelerator-tables.md)
6060
##### [Accelerator Keys](predefined-accelerator-keys.md)
6161
#### [Binary Editor](binary-editor.md)
62-
##### [Creating a New Custom or Data Resource](creating-a-new-custom-or-data-resource.md)
63-
##### [Opening a Resource for Binary Editing](opening-a-resource-for-binary-editing.md)
64-
##### [Editing Binary Data](editing-binary-data.md)
65-
##### [Finding Binary Data](finding-binary-data.md)
6662
#### [Dialog Editor](dialog-editor.md)
6763
##### [Creating a New Dialog Box](creating-a-new-dialog-box.md)
6864
##### [Creating a Dialog Box That Users Cannot Exit](creating-a-dialog-box-that-users-cannot-exit.md)
@@ -71,20 +67,13 @@
7167
##### [Controls in Dialog Boxes](controls-in-dialog-boxes.md)
7268
###### [Adding, Editing, or Deleting Controls](adding-editing-or-deleting-controls.md)
7369
####### [Adding a Control to a Dialog Box](adding-a-control-to-a-dialog-box.md)
74-
######## [Dialog Editor Tab, Toolbox](dialog-editor-tab-toolbox.md)
75-
####### [Adding Multiple Controls](adding-multiple-controls.md)
76-
####### [Sizing a Control While You Add It](sizing-a-control-while-you-add-it.md)
7770
####### [Editing Control Properties](editing-control-properties.md)
7871
####### [Deleting a Control](deleting-a-control.md)
7972
####### [Viewing and Adding ActiveX Controls to a Dialog Box](viewing-and-adding-activex-controls-to-a-dialog-box.md)
80-
######## [Insert ActiveX Control Dialog Box](insert-activex-control-dialog-box.md)
81-
######## [Editing Properties for an ActiveX Control](editing-properties-for-an-activex-control.md)
8273
####### [Adding Event Handlers for Dialog Box Controls](adding-event-handlers-for-dialog-box-controls.md)
8374
####### [Default Control Events](default-control-events.md)
8475
####### [Defining Member Variables for Dialog Controls](defining-member-variables-for-dialog-controls.md)
8576
###### [Selecting Controls](selecting-controls.md)
86-
####### [Selecting Multiple Controls](selecting-multiple-controls.md)
87-
####### [Specifying the Dominant Control](specifying-the-dominant-control.md)
8877
###### [Sizing Individual Controls](sizing-individual-controls.md)
8978
###### [Making Controls the Same Width, Height, or Size](making-controls-the-same-width-height-or-size.md)
9079
###### [Setting the Size of the Combo Box and Its Drop-Down List](setting-the-size-of-the-combo-box-and-its-drop-down-list.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.

0 commit comments

Comments
 (0)