Grayed menu items not working with TrackPopupMenu()? 
Author Message
 Grayed menu items not working with TrackPopupMenu()?

Hello,

I am displaying a context menu with TrackPopupMenu(),
and no matter what I do I cannot get a menu item
to display "grayed". Even if I check the "grayed" style
when I create the menu in the resource editor, it still
displays normally when I display the menu with
TrackPopupMenu().

HUH?  Any idea what I'm doing wrong?

peter



Sun, 15 Apr 2001 03:00:00 GMT  
 Grayed menu items not working with TrackPopupMenu()?

Try changing the menu between when you load it and when you call
TrackPopupMenu.  Basically, just use CMenu::EnableMenuItem.  If the
window specified in your call to TrackPopupMenu is derived from
CFrameWnd, you might be able to use a OnUpdateUI* member.

Quote:

> Hello,

> I am displaying a context menu with TrackPopupMenu(),
> and no matter what I do I cannot get a menu item
> to display "grayed". Even if I check the "grayed" style
> when I create the menu in the resource editor, it still
> displays normally when I display the menu with
> TrackPopupMenu().

> HUH?  Any idea what I'm doing wrong?

> peter

  will.vcf
< 1K Download


Sun, 15 Apr 2001 03:00:00 GMT  
 Grayed menu items not working with TrackPopupMenu()?
I had this same problem.  There is a boolean variable
that controls whether menu's are automatically
enabled/disabled depending on having a Command or
UpdateCommandUI events.  If you put the code for
disabling in UpdateCommandUI then it should work, or set
the boolean for automenu to false.

Jon Greisz
DB Microware, Inc.



Quote:

> Hello,

> I am displaying a context menu with TrackPopupMenu(),
> and no matter what I do I cannot get a menu item
> to display "grayed". Even if I check the "grayed" style
> when I create the menu in the resource editor, it still
> displays normally when I display the menu with
> TrackPopupMenu().

> HUH?  Any idea what I'm doing wrong?

> peter



Sun, 15 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Menu items: Not being grayed.

2. Cannot gray out menu item for a dialog menu

3. Graying a menu item.

4. Graying a menu item.

5. Grayed Menu Items

6. How can I grayed menu-items

7. Graying out menu items

8. Can't dynamically gray out menu items.

9. Graying out menu items?

10. Menu item that doesn't get grayed

11. graying menu items

12. Graying (Disabling Menu Item)

 

 
Powered by phpBB® Forum Software