Skip to content

Commit 2f68169

Browse files
authored
Merge pull request #1703 from msebolt/resource-file-consolidation-pr19
resource file consolidation pr19
2 parents b5f1c18 + 8127f64 commit 2f68169

5 files changed

Lines changed: 53 additions & 78 deletions

File tree

‎.openpublishing.redirection.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7515,6 +7515,16 @@
75157515
"redirect_url": "/cpp/windows/creating-a-256-color-icon-or-cursor-image-editor-for-icons",
75167516
"redirect_document_id": false
75177517
},
7518+
{
7519+
"source_path": "docs/windows/inserting-a-new-menu-between-existing-menus.md",
7520+
"redirect_url": "/cpp/windows/creating-a-menu",
7521+
"redirect_document_id": false
7522+
},
7523+
{
7524+
"source_path": "docs/windows/adding-commands-to-a-menu.md",
7525+
"redirect_url": "/cpp/windows/creating-a-menu",
7526+
"redirect_document_id": false
7527+
},
75187528
{
75197529
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
75207530
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@
129129
##### [Accelerator Keys (Image Editor for Icons)](accelerator-keys-image-editor-for-icons.md)
130130
#### [Menu Editor](menu-editor.md)
131131
##### [Creating a Menu](creating-a-menu.md)
132-
###### [Inserting a New Menu Between Existing Menus](inserting-a-new-menu-between-existing-menus.md)
133-
###### [Adding Commands to a Menu](adding-commands-to-a-menu.md)
134132
##### [Deleting Menus and Menu Commands](deleting-menus-and-menu-commands.md)
135133
##### [Creating a Submenu](creating-a-submenu.md)
136134
##### [Creating Pop-up Menus](creating-pop-up-menus.md)

‎docs/windows/adding-commands-to-a-menu.md‎

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

‎docs/windows/creating-a-menu.md‎

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,26 @@
22
title: "Creating a Menu (C++)"
33
ms.date: "11/04/2016"
44
f1_keywords: ["vc.editors.menu"]
5-
helpviewer_keywords: ["mnemonics [C++], associating menu items", "menus [C++], associating commands with mnemonic keys", "menus [C++], creating"]
5+
helpviewer_keywords: ["mnemonics [C++], associating menu items", "menus [C++], associating commands with mnemonic keys", "menus [C++], creating", "menus [C++], adding items", "commands [C++], adding to menus", "menu items, adding to menus"]
66
ms.assetid: 66f94448-9b97-4b73-bf97-10d4bf87cc65
77
---
88
# Creating a Menu (C++)
99

1010
> [!NOTE]
1111
> The **Resource Window** is not available in Express editions.
1212
13-
### To create a standard menu
13+
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).
1414

15-
1. From the **View** menu, click on **Resource View** and then right-click on the **Menu** heading and choose **Add Resource**. Choose **Menu**.
15+
## To create a standard menu
1616

17-
2. Select the **New Item** box (the rectangle that contains "Type Here") on the menu bar.
17+
1. From the **View** menu, select **Resource View** and then right-click on the **Menu** heading and choose **Add Resource**. Choose **Menu**.
18+
19+
1. Select the **New Item** box (the rectangle that contains "Type Here") on the menu bar.
1820

1921
![New Item box in the menu editor](../windows/media/vcmenueditornewitembox.gif "vcMenuEditorNewItemBox")<br/>
2022
New Item Box
2123

22-
3. Type a name for your new menu, for example, "File".
24+
1. Type a name for your new menu, for example, "File".
2325

2426
The text you type appears in both the **Menu** editor and in the **Caption** box in the [Properties Window](/visualstudio/ide/reference/properties-window). You can edit the properties for your new menu in either location.
2527

@@ -31,7 +33,42 @@ ms.assetid: 66f94448-9b97-4b73-bf97-10d4bf87cc65
3133
> [!NOTE]
3234
> To create a single-item menu on the menu bar, set the **Popup** property to **False**.
3335
34-
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).
36+
## To insert a new menu between existing menus
37+
38+
Select an existing menu name and press the **Insert** key. The **New Item** box is inserted before the selected item.
39+
40+
\- or -
41+
42+
Right-click on the menu bar and choose **Insert New** from the shortcut menu.
43+
44+
## To add commands to a menu
45+
46+
1. Create a menu.
47+
48+
1. Select a menu name, for example, **File**.
49+
50+
Each menu will expand and expose a new item box for commands. For example, you can add the commands **New**, **Open**, and **Close** to a **File** menu.
51+
52+
1. In the new item box, type a name for the new menu command.
53+
54+
> [!NOTE]
55+
> The text you type appears in both the **Menu** editor and in the **Caption** box in the [Properties Window](/visualstudio/ide/reference/properties-window). You can edit the properties for your new menu in either location.
56+
57+
> [!TIP]
58+
> You can define a mnemonic key (hot key) that allows the user to select the menu command. Type an ampersand (`&`) in front of a letter to specify it as the mnemonic. The user can select the menu command by typing that letter.
59+
60+
1. In the **Properties** window, select the menu command properties that apply. For details, see [Menu Command Properties](../windows/menu-command-properties.md).
61+
62+
1. In the **Prompt** box in the **Properties** window, type the prompt string you want to appear in your application's status bar.
63+
64+
This step creates an entry in the string table with the same resource identifier as the menu command you created.
65+
66+
> [!NOTE]
67+
> Prompts can only apply to menu items with a **Popup** property of **True**. For example, top-level menu items can have prompts if they have sub-menu items. The purpose of a **Prompt** is to indicate what will happen if a user selects the menu item.
68+
69+
1. Press **Enter** to complete the menu command.
70+
71+
The new item box is selected so you can create additional menu commands.
3572

3673
## Requirements
3774

‎docs/windows/inserting-a-new-menu-between-existing-menus.md‎

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

0 commit comments

Comments
 (0)