Method 1: Pro-Test successfully reproduced from Https://social.msdn.microsoft.com/Forums/vstudio/zh-CN/48338f6b-e5d9-4c0c-8b17-05ca3ef1f761/vs2010dialog
You can create a menu as a resource and then attach it to a dialog box. Open the dialog" Properties" dialog box, you can see a menu property, and in the end we will specify an ID for our own creation.
The steps are as follows:
• in the resource view, right-click the project name and insert a new menu. This menu will have an ID(for example: idr_menu1 );
• the menu can be designed to suit your needs.
• After designing the menu, in the Dialog menu property drop- down list, select the desired menu ID(here idr_menu1)
Now that the compilation is running, the menu can be displayed in the dialog box.
Method 2: Reproduced not tried
Add menu in VC + + dialog box program
Create a dialog-based MFC program in VC with a total of three steps to add the menu:
1, first insert a menu resource idr_menu1, and then you can edit the Modify menu;
2. Then add a member variable M_menu for the CMenu type for the dialog box;
3. Add the following code in OnInitDialog ():
M_menu.loadmenu (idr_menu1);//Load Menu
SetMenu (&m_menu); Show Menu
After these three steps, the menu can be displayed.
How to add a menu in the VS2010 VC + + dialog-based MFC program