Those changing menu in VC

zhaozj2021-02-16  60

>

Talking about the dynamic change menu in VC

Most of the Windows applications use the drop-down menu to implement your own specific functions, which makes the programming, and does not need to add multiple buttons to the program to complete these operations. In most cases, after our program is compiled, the menu is determined and cannot be modified. However, in many cases, the program is necessary to generate different menus based on the user's own settings to accommodate different users, which requires our dynamic changing menu. Next, we analyze how different menus are generated. Step 1: Run AppWizard Generate a project MyMENU to accept all the default settings, except for the following: Single Document in Step 1, click the Finish button, and we have generated a project. Compilation, we can discover the menu generated by the program default, then we have to modify this menu. Step 2: Add a menu resource, as follows: INSERTàResouceàMenuànew is selected in the menu, we can see the menu resource added to add IDR_Menu1, as for the various items in the menu, you will add it, for our programming Please add a few items, the first column is to include several submenus. Step 3: Add a dialogue resource, as follows: INSERTàResouceàDialogànew is selected in the menu, we can see the dialog resource added to IDD_DIALOG1, add six buttons, as shown below: ID_Clear, ID_GOONE , Id_gotwo, id_add, id_additem, id_edit, define class name cchangeMenu for dialog box, double-click the added six buttons to increase the processing function, with the default function name.

转载请注明原文地址:https://www.9cbs.com/read-24310.html

New Post(0)