Software Development Network>> Visual C++>> checking menu items
Lookup SetMenuItemInfo, MENUITEMINFO, and MFS_CHECKED on MSDN.
Nathan87 wrote:How do you check a menu item in Visual Studio.Net 2003 using MFC
The MFC way is not to manipulate the menu directly. There is a so called OnCommand Handler and OnUpdateCommand handelr technique.
In the OnUpdate Handler of your command just use pCmdUI->SetCheck(m_bMyState);
checking menu items
habnix
Lookup SetMenuItemInfo, MENUITEMINFO, and MFS_CHECKED on MSDN.
GTH
The MFC way is not to manipulate the menu directly. There is a so called OnCommand Handler and OnUpdateCommand handelr technique.
In the OnUpdate Handler of your command just use pCmdUI->SetCheck(m_bMyState);
RoseyA
CWnd::OnContextMenu()...
CMenu menu;
menu.LoadMenu(IDR_POPUP_MENU);
CMenu *popupMenu = menu.GetSubMenu(0);
popupMenu->CheckMenuItem(ID_DOCKED, MF_BYCOMMAND | (isDocked MF_CHECKED : MF_UNCHECKED));
Thanks again for all the help.