I've got a simple menu, created it in the resource editor and made it the menu for my main Dialog window. (CRSMDlg) How do I get my menu to display a check / tick box next to the item when I click on it. I tried adding the ON_UPDATE_COMMAND_UI event handler but no matter what I do the menu item is not "ticked" : void CRSMDlg::OnUpdateOps(CCmdUI *pCmdUI) { pCmdUI->SetCheck(1); } Is there an update / repaint method I must call, some property I must set on the Dialog box to inform it ? Also I found that the shortcut keys does not display when you click on File, but if you keep the ALT button , then only it displays it - can we switch this behaviour off ?
![]() |
0 |
![]() |
void CMenuDlg::OnMnuChk_Click() { CMenu * cm = GetMenu(); if( cm->CheckMenuItem( IDR_MNU_CHK, MF_CHECKED ) == 0 ) { cm->CheckMenuItem( IDR_MNU_CHK, MF_CHECKED ); } else { cm->CheckMenuItem( IDR_MNU_CHK, MF_UNCHECKED ); } UpdateData( false ); } "PIETER CLAASSENS" <erica.altini@blueyonder.co.uk> schreef in bericht news:zMH9e.9897$gz2.6493@fe3.news.blueyonder.co.uk... > I've got a simple menu, created it in the resource editor and made it the > menu for my main Dialog window. (CRSMDlg) > > How do I get my menu to display a check / tick box next to the item when I > click on it. I tried adding the ON_UPDATE_COMMAND_UI event handler but no > matter what I do the menu item is not "ticked" : > > void CRSMDlg::OnUpdateOps(CCmdUI *pCmdUI) { > pCmdUI->SetCheck(1); > > } > > Is there an update / repaint method I must call, some property I must set > on > the Dialog box to inform it ? > > Also I found that the shortcut keys does not display when you click on > File, > but if you keep the ALT button , then only it displays it - can we switch > this behaviour off ? > > > > >
![]() |
0 |
![]() |
Thx moi , I also found the following link that solved my problem - http://support.microsoft.com/default.aspx?scid=kb;en-us;242577 Regards Pieter "moi" <coffeecop@_NOSPAM_planet.nl> wrote in message news:d482dd$43p$1@reader11.wxs.nl... > > void CMenuDlg::OnMnuChk_Click() > { > CMenu * cm = GetMenu(); > if( cm->CheckMenuItem( IDR_MNU_CHK, MF_CHECKED ) == 0 ) { > cm->CheckMenuItem( IDR_MNU_CHK, MF_CHECKED ); > } else { > cm->CheckMenuItem( IDR_MNU_CHK, MF_UNCHECKED ); > } > UpdateData( false ); > } > > > "PIETER CLAASSENS" <erica.altini@blueyonder.co.uk> schreef in bericht > news:zMH9e.9897$gz2.6493@fe3.news.blueyonder.co.uk... >> I've got a simple menu, created it in the resource editor and made it the >> menu for my main Dialog window. (CRSMDlg) >> >> How do I get my menu to display a check / tick box next to the item when >> I >> click on it. I tried adding the ON_UPDATE_COMMAND_UI event handler but no >> matter what I do the menu item is not "ticked" : >> >> void CRSMDlg::OnUpdateOps(CCmdUI *pCmdUI) { >> pCmdUI->SetCheck(1); >> >> } >> >> Is there an update / repaint method I must call, some property I must set >> on >> the Dialog box to inform it ? >> >> Also I found that the shortcut keys does not display when you click on >> File, >> but if you keep the ALT button , then only it displays it - can we switch >> this behaviour off ? >> >> >> >> >> > >
![]() |
0 |
![]() |