I have a MFC CMenu with some items. I would like to convert or replace a single menu item with a sub-menu, with additional menu items. Is there an easy way to do that ?
1
There are 1 best solutions below
Related Questions in MFC
- Cannot "Go To Definition" in Visual C++ 2013
- reset mdi child view position
- Add a picture to Picture Control in a dialog box (error RC2108: expected numerical dialog constant)
- Background color for controls in MFC C++ is unable to set
- variable global const "macros" in C++ and optimal design patterns
- Converting long double to CString
- postmessage and message loop in different thread
- How to convert CString to long? VC++
- Can a dialog intercept drag'n'drop messages passed to its controls?
- Can I close (note, not terminate) a user process from a service by its PID?
- How can I have a multi-line item in a ListControl MFC?
- Getting the messages back to the same command line from where the MFC application was launched
- MFC - How to set the toolbar title?
- MFC SetTitle() causing weird debug assertion
- Application logs on the command prompt from where application is being launched
Related Questions in SUBMENU
- CSS Menu system not working in IOS 8
- Click Event is executed automatically
- Android support:design NavigationView checked menu sub items
- Expand or collapse all sub menus regardless of whether all or some are already expanded or collapsed
- Floating Action Menu Like Inbox app : What is best way to implement
- Submenu of a submenu HTML+CSS
- Excel 2010 VBA Can't get Sub Menus to display
- In Wordpress Using Elegant Theme's Divi Theme, Long menus don't show
- How to break out of loops in a Menu/Sub-Menu
- How to center absolute dynamic width ul submenu?
- though jQuery .toggle() dropdown (less than 991px width)
- SubMenu clicking issue in Selenium
- Wordpress - main navigation click to open sub-menu
- How can I show current submenu items at bottom of page?
- How can I implement `window.onlick = function(event){` to close drop down menu?
Related Questions in CMENU
- How can I resize an application menu bar in a MFC application?
- How can I assign a class to the unordered list created by Menu Widget in Yii?
- Yii Login Issues
- MFC: How do you add a bitmap to CMenu items added on OnInitMenuPopup?
- Is there an easier way to determine that none of the menu items are set to MF_CHECKED
- Handling dynamically populated CMenu messages
- Removing top level Menu item (in MFC). .
- C++ - MFC - Set height of CMenu
- CMenu border color on MFC
- CMenu replace item with submenu
- How can I show a checkbox in an owner-drawn MFC CMenu derived menu?
- How do I get system default checkbox BITMAP in VS2015?
- MFC : How to add tooltip in Cmenu items?
- Why can't I disable/gray out menuitem? (MFC)
- MFC: How to detect right-click on popup menu item?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The
CMenuclass provides the class memberCMenu::SetMenuItemInfoto modify an existing menu item by passing it a properly initializedMENUITEMINFOstructure.To replace a menu item with a pop-up menu (sub menu) you have to perform 3 steps.
1. Create a new pop-up menu
You can either create the menu dynamically by calling
CMenu::CreatePopupMenuand populate it withCMenu::InsertMenuItemor load an existing pop-up menu from a resource usingCMenu::LoadMenu:2. Initialize a
MENUITEMINFOstructure3. Replace existing menu item
The call to
DrawMenuBaris required whenever a window's menu is modified.