Partager via


CCmdUI::Enable

Call this member function to enable or disable the user-interface item for this command.

virtual void Enable(
   BOOL bOn = TRUE 
);

Parameters

  • bOn
    TRUE to enable the item, FALSE to disable it.

Example

ON_UPDATE_COMMAND_UI(ID_FILE_SAVE, &CMyDoc::OnUpdateFileSave)
void CMyDoc::OnUpdateFileSave(CCmdUI* pCmdUI)
{
   // Enable the menu item if the file has been modified.
   pCmdUI->Enable(m_bModified);   
}

Requirements

Header: afxwin.h

See Also

Reference

CCmdUI Class

Hierarchy Chart

CCmdUI::SetCheck

Other Resources

CCmdUI Members