
Trying to disable Menu Item and ToolbarCtrl item..
Quote:
> Sounds easy enough right?
> Well I thought so too but have not had the desired results..
> I am getting the menu from withing the mainfram GetMenu()
> I get it then use:
> menu->EnableMenuItem(id, MF_GRAYED);
> This I thought should have done it. The return value seems to be valid but
> still no disabling is taking place
> As for the toolbar I do
> toobarctrl.EnableButton(id,FALSE);
> Again this seems to return valid results but it is not disabled.
> Any ideas? anybody?
> Thanks,
Go back to the class wizard where you first created the handler for the
menu item. Click on the UPDATE_COMMAND_UI choice to create an update
handler for the menu item/button that you want to disable. Then use
something like...
if(iMyFlag) pCmdUI->Enable(FALSE);
else pCmdUI->Enable(TRUE);
--
Cecil Galbraith
Free programmer's utilities and MFC tips at
http://www.concentric.net/~cgalbrai