Menu, same question again
I wrote the code for check and uncheck the menu in dialog base app,
but it doesn't work.
void CMyDlg::OnEditShow()
{
// TODO: Add your command handler code here
// Do something...
}
void CMyDlg::OnUpdateEditShow(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
if( m_bShow==TRUE )
{
pCmdUI->SetCheck(1);
m_bShow=FALSE;
}
else
{
pCmdUI->SetCheck(0);
m_bShow=TRUE;
}
}
Could anyone tell me how can I check and uncheck the menu in dialog base app?
Thanks in advance.
Re: Menu, same question again
Add this to the command code:
CMenu* pMenu = GetMenu();
pMenu->CheckMenuItem(yourID, MF_BYCOMMAND | MF_CHECKED);
Let me know if this helps you.
Best regards,
Faby
Re: Menu, same question again
Hi Faby,
Thanks for your code, it works.