Can't Gray out Menu Item

I am migrating evc4.0 to .Net 2005. I am having trouble graying out a menu item.

UINT bshow=false;

if(theUndoManager.HasRedoItems())

bshow=MF_ENABLED;

else

bshow =MF_GRAYED;

CMenu* mmenu = GetDialogMenu();

CMenu* submenu = mmenu->GetSubMenu(0);

UINT temp = submenu->EnableMenuItem( ID_EDIT_REDO, MF_DISABLED | MF_GRAYED);

I can't seem to make a menu item grayed out. Do I need to call some kind of update to the command bar or menu Anyone have suggestiosn



Answer this question

Can't Gray out Menu Item

  • Audrey N. T.

    I fixed it!

    I had to use

    ON_UPDATE_COMMAND_UI in the message map. Which is odd considering it was usable on the old EVC 4.


  • SHARANU

    Thanks for posting the resolution.



  • Can't Gray out Menu Item