且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

带有复选框选择的菜单

更新时间:2023-11-20 23:10:22

要在菜单项中添加/删除检查,请为该菜单项添加OnUpdatexxx()处理函数.

CCmdUI [
To add/remove a check in a menu item, you add an OnUpdatexxx() handler for that menu item.

The CCmdUI[^] instance handed to you can be used for this.

Something like:
void CMyFrame::OnUpdateShowMyToolbar(CCmdUI *pCmdUI)
{
    pCmdUI->SetCheck(IsMyToolbarVisible() ? 0 : 1);
}