Program I'm working on is being ported from VB, and the VB version has two different Edit menus depending on the mode the program is in. Actually, it is one edit menu, but depending on the program mode, certain elements of the menu are set to be not visible, and only the elements of the menu which pertain to the mode the program is in is visible.
Announcement
Collapse
No announcement yet.
Need Recommendations On Dynamic Menus
Collapse
X
-
I personally never liked menus which change, I much prefer menus which contain "everything," with each option always visible and in the same position on that menu. If an option is not currently active, it is disabled (which shows as grayed).
So was that the question, what do you prefer?
Or you wanted a hint as to how to code that style?
To enable or disable menu items you use the EnableMenuItem() Winapi function if coding SDK-style, or the MENU SET STATE command if coding DDT-style.Michael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
-
I agree with Michael but if you really want to change one menu configuration for another, create two menu bars in your code and swap them as required:
MENU NEW BAR TO hMenu1
....
MENU NEW BAR TO hMenu2
....
MENU ATTACH hMenu1 , hDlg ' Attach the first
....Swap for the second
MENU ATTACH hMenu2 , hDlg ' ("Attach a menu to a dialog, replacing any existing menu")
...Swap backRgds, Dave
Comment
-
DeleteMenu/InsertMenuItem works fine for dynamically adding/removing menu items.
Comment
Comment