multi-level menu

Posted on 2000-03-23
Last Modified: 2013-11-20
when i create a multi-level popup menu,
it returns only when i click the menu item which has a command ID,but i want it also can returns when i click the item which contains a submenu.

how can i do this? any suggestion is appreciated. thank you.

Question by:Mike2000
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 31

Expert Comment

ID: 2652605
Hi Mike2000,

I don't understand.

>'but i want it also can returns when i click the item which contains a submenu'

how would you then be able to open the sub-menu???

LVL 10

Expert Comment

ID: 2652730
Indeed .. what is the point of a submenu if the popup returns (and so disappears) when you click on that item.

Only thing I can think that you are trying to do is to have an item on the menu that LOOKS like a submenu, and when you click on it, you (say) generate the submenu andpop it up.

In this case, if you want to make a menu LOOK like it is a submenu, then you'll want to owner-draw your menu so that you draw the little triangle that indicates a submenu.  When first popped up, you'd make the pseudo-submenu itme a regular menu item with a command id.  When the user clicks on it, do whatever work you want, set that item to be a real submenu item and redisplay the menu.  Even this would probably be a bit 'clunky' nd ugly, but is all I can think of for you.

This would be tricky, because
LVL 31

Expert Comment

ID: 2652954
Hi Mike2000,

if that (what RONSLOW sayd) is what you want then you can simply create an empty popup menu and handle the WM_INITMENUPOPUP message to dynamically create items for the popup menu.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 10

Expert Comment

ID: 2653145
good idea Zoppo

Author Comment

ID: 2655872
i want it to be a normal menu item as well as a submenu item,when you click on it, it returns it's commamd ID,and when your mouse move over it,popup the submenu .the whole menu is dynamically
LVL 10

Accepted Solution

RONSLOW earned 100 total points
ID: 2656422
changing default behaviour like that is a bad idea .. it confuses the user.

How do you expect to click on it without hovering over it (unless you are really quick).

And clicking on a submenu item should pop up the submenu anyway, so your users are going to wonder what on earth is going on.

I'd reconsider my design / requirements if I were you.

LVL 10

Expert Comment

ID: 2659196
I've got your code to compile and link.

I use <iostream> instead or <iostream.h>

AND I included "using namespace std;" in each .h file (after the #include of iostream, iomanip etc).

All works fine.

The problem was that you had both the std:ostream and ostream defined, and the compiler didn't know which one you meant.  Consistent usage of the namespace in the header files, and the use of <iostream> instead or <iostream.h> fixes all that.

Can I submit this as an aswer please???


Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question