Skip to content

Commit 8ad03d0

Browse files
authored
Merge pull request MicrosoftDocs#1712 from msebolt/resource-file-consolidation-pr25
resource file consolidation pr25
2 parents d149afd + 94d6ac1 commit 8ad03d0

11 files changed

+128
-254
lines changed

.openpublishing.redirection.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7590,6 +7590,46 @@
75907590
"redirect_url": "/cpp/windows/converting-bitmaps-to-toolbars",
75917591
"redirect_document_id": false
75927592
},
7593+
{
7594+
"source_path": "docs/windows/creating-a-new-toolbar-button.md",
7595+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7596+
"redirect_document_id": false
7597+
},
7598+
{
7599+
"source_path": "docs/windows/moving-a-toolbar-button.md",
7600+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7601+
"redirect_document_id": false
7602+
},
7603+
{
7604+
"source_path": "docs/windows/copying-buttons-from-a-toolbar.md",
7605+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7606+
"redirect_document_id": false
7607+
},
7608+
{
7609+
"source_path": "docs/windows/deleting-a-toolbar-button.md",
7610+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7611+
"redirect_document_id": false
7612+
},
7613+
{
7614+
"source_path": "docs/windows/inserting-a-space-between-buttons-on-a-toolbar.md",
7615+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7616+
"redirect_document_id": false
7617+
},
7618+
{
7619+
"source_path": "docs/windows/removing-space-between-buttons-on-a-toolbar.md",
7620+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7621+
"redirect_document_id": false
7622+
},
7623+
{
7624+
"source_path": "docs/windows/changing-the-properties-of-a-toolbar-button.md",
7625+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7626+
"redirect_document_id": false
7627+
},
7628+
{
7629+
"source_path": "docs/windows/toolbar-button-properties.md",
7630+
"redirect_url": "/cpp/windows/creating-moving-and-editing-toolbar-buttons",
7631+
"redirect_document_id": false
7632+
},
75937633
{
75947634
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
75957635
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

docs/windows/TOC.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@
139139
##### [Creating New Toolbars](creating-new-toolbars.md)
140140
##### [Converting Bitmaps to Toolbars](converting-bitmaps-to-toolbars.md)
141141
##### [Creating, Moving, and Editing Toolbar Buttons](creating-moving-and-editing-toolbar-buttons.md)
142-
###### [Creating a New Toolbar Button](creating-a-new-toolbar-button.md)
143-
###### [Moving a Toolbar Button](moving-a-toolbar-button.md)
144-
###### [Copying Buttons from a Toolbar](copying-buttons-from-a-toolbar.md)
145-
###### [Deleting a Toolbar Button](deleting-a-toolbar-button.md)
146-
###### [Inserting a Space Between Buttons on a Toolbar](inserting-a-space-between-buttons-on-a-toolbar.md)
147-
###### [Removing Space Between Buttons on a Toolbar](removing-space-between-buttons-on-a-toolbar.md)
148-
###### [Changing the Properties of a Toolbar Button](changing-the-properties-of-a-toolbar-button.md)
149-
####### [Toolbar Button Properties](toolbar-button-properties.md)
150142
##### [Creating a Tool Tip for a Toolbar Button](creating-a-tool-tip-for-a-toolbar-button.md)
151143
#### [Version Information Editor](version-information-editor.md)
152144
##### [Editing a String in a Version Information Resource](editing-a-string-in-a-version-information-resource.md)

docs/windows/changing-the-properties-of-a-toolbar-button.md

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

docs/windows/copying-buttons-from-a-toolbar.md

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

docs/windows/creating-a-new-toolbar-button.md

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 88 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,111 @@
11
---
22
title: "Creating, Moving, and Editing Toolbar Buttons (C++)"
33
ms.date: "11/04/2016"
4-
helpviewer_keywords: ["buttons [C++], custom toolbars", "toolbar buttons [C++], editing", "buttons", "toolbar buttons [C++], creating"]
4+
f1_keywords: ["vc.editors.toolbar"]
5+
helpviewer_keywords: ["buttons [C++], custom toolbars", "toolbar buttons [C++], editing", "buttons", "toolbar buttons [C++], creating", "Toolbar editor [C++], creating buttons", "toolbar buttons [C++], button image", "toolbar buttons [C++], creating", "toolbar buttons (in Toolbar editor)", "toolbar buttons [C++], moving", "Toolbar editor [C++], moving buttons", "Toolbar editor [C++], copying buttons", "toolbars [C++], copying buttons", "toolbar buttons [C++], copying", "toolbar buttons [C++], deleting", "Toolbar editor [C++], deleting buttons", "Toolbar editor [C++], spacing toolbar buttons", "toolbar buttons [C++], space between buttons", "toolbar controls [MFC], command ID", "toolbar buttons [C++], setting properties", "Toolbar editor [C++], toolbar button properties", "command IDs, toolbar buttons", "size, toolbar buttons", "toolbar buttons [C++], setting properties", "Toolbar editor [C++], toolbar button properties", "status bars [C++], active toolbar button text", "command IDs, toolbar buttons", "width, toolbar buttons"]
56
ms.assetid: d0f0c6c6-9d7e-42b5-a86a-7558127386e7
67
---
7-
# Creating, Moving, and Editing Toolbar Buttons
8+
# Creating, Moving, and Editing Toolbar Buttons (C++)
89

910
You can easily create, move, copy, and edit toolbar buttons.
1011

11-
By default, a new or blank button is displayed at the right end of the toolbar. You can move this button before editing it. When you create a new button, another blank button appears to the right of the edited button. When you save a toolbar, the blank button is not saved.
12+
By default, a new or blank button is displayed at the right end of the toolbar. You can move this button before editing it. When you create a new button, another blank button appears to the right of the edited button. When you save a toolbar, the blank button isn't saved.
1213

13-
- [Create a new toolbar button](creating-a-new-toolbar-button.md)
14+
The properties of a toolbar button are:
1415

15-
- [Move a toolbar button](moving-a-toolbar-button.md)
16+
|Property|Description|
17+
|--------------|-----------------|
18+
|**ID**|Defines the ID for the button. The drop-down list provides common **ID** names.|
19+
|**Width**|Sets the width of the button. 16 pixels is recommended.|
20+
|**Height**|Sets the height of the button. The height of one button changes the height of all buttons on the toolbar. 15 pixels is recommended.|
21+
|**Prompt**|Defines the message displayed in the status bar. Adding \n and a name adds a ToolTip to that toolbar button. For more information, see [Creating a ToolTip](../windows/creating-a-tool-tip-for-a-toolbar-button.md).|
1622

17-
- [Copy buttons from a toolbar resource](../windows/copying-buttons-from-a-toolbar.md)
23+
**Width** and **Height** apply to all buttons. A bitmap that is used to create a toolbar has a maximum width of 2048. So if you set the button width to 512, you can only have four buttons and if you set the width to 513, you can only have three buttons.
1824

19-
- [Delete a toolbar button](deleting-a-toolbar-button.md)
25+
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).
2026

21-
- [Insert a space between buttons on a toolbar resource](../windows/inserting-a-space-between-buttons-on-a-toolbar.md)
27+
See the following actions:
2228

23-
- [Close up a space between buttons on a toolbar](../windows/removing-space-between-buttons-on-a-toolbar.md)
29+
## To create a new toolbar button
2430

25-
- [Edit the property page of a toolbar](../windows/changing-the-properties-of-a-toolbar-button.md)
31+
1. In [Resource view](../windows/resource-view-window.md) expand the resource folder (for example, *Project1.rc*).
2632

27-
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).
33+
> [!NOTE]
34+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
35+
36+
1. Expand the **Toolbar** folder and select a toolbar to edit.
37+
38+
1. Assign an ID to the blank button at the right end of the toolbar. You can do so by editing the **ID** property in the [Properties Window](/visualstudio/ide/reference/properties-window). For example, you may want to give a toolbar button the same ID as a menu option. In this case, use the drop-down list box to select the **ID** of the menu option.
39+
40+
-or-
41+
42+
Select the blank button at the right end of the toolbar (in the **Toolbar View** pane) and begin drawing. A default button command ID is assigned (ID_BUTTON\<n>).
43+
44+
You can also copy and paste an image onto a toolbar as a new button.
45+
46+
## To add an image to a toolbar as a button
47+
48+
1. In [Resource View](../windows/resource-view-window.md), open the toolbar by double-clicking it.
49+
50+
1. Next, open the image you'd like to add to your toolbar.
51+
52+
> [!NOTE]
53+
> If you open the image in Visual Studio, it will open in the **Image** editor. You can also open the image in other graphics programs.
54+
55+
1. From the **Edit** menu, choose **Copy**.
56+
57+
1. Switch to your toolbar by selecting its tab at the top of the source window.
58+
59+
1. From the **Edit** menu, choose **Paste**.
60+
61+
The image will appear on your toolbar as a new button.
62+
63+
## To move a toolbar button
64+
65+
In the **Toolbar View** pane, drag the button that you want to move to its new location on the toolbar.
66+
67+
## To copy buttons from a toolbar
68+
69+
1. Hold down the **Ctrl** key.
70+
71+
1. In the **Toolbar View** pane, drag the button to either its new location on the toolbar or to a location on another toolbar.
72+
73+
## To delete a toolbar button
74+
75+
Select the toolbar button and drag it off the toolbar.
76+
77+
## To insert or remove space between buttons on a toolbar
78+
79+
In general, to insert a space between buttons, drag them away from one another on the toolbar. To remove space, drag them towards each other.
80+
81+
### To insert a space before a button that isn't followed by a space
82+
83+
Drag the button to the right or down until it overlaps the next button about halfway.
84+
85+
### To insert a space before a button that is followed by a space and to keep the trailing space
86+
87+
Drag the button until the right or bottom edge is just touching the next button or just overlaps it.
88+
89+
### To insert a space before a button that is followed by a space and close up that following space
90+
91+
Drag the button to the right or down until it overlaps the next button about halfway.
92+
93+
### To remove a space between buttons on a toolbar
94+
95+
Drag the button on one side of the space toward the button on the other side of the space until it overlaps the next button about halfway.
96+
97+
If there's no space on the side of the button that you're dragging away from, and you drag the button more than halfway past the adjacent button, the **Toolbar** editor also inserts a space on the opposite side of the button that you're dragging.
98+
99+
## To change the properties of a toolbar button
100+
101+
1. In a C++ project, select the toolbar button.
102+
103+
1. Type the new ID in the **ID** property in the [Properties Window](/visualstudio/ide/reference/properties-window), or use the drop-down list to select a new **ID**.
28104

29105
## Requirements
30106

31107
MFC or ATL
32108

33109
## See Also
34110

35-
[Toolbar Editor](../windows/toolbar-editor.md)
111+
[Toolbar Editor](../windows/toolbar-editor.md)

docs/windows/deleting-a-toolbar-button.md

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

0 commit comments

Comments
 (0)