Share via


CFrameWnd::m_bAutoMenuEnable

Remarks

When this data member is enabled (which is the default), menu items that do not have ON_UPDATE_COMMAND_UI or ON_COMMAND handlers will be automatically disabled when the user pulls down a menu.

Menu items that have an ON_COMMAND handler but no ON_UPDATE_COMMAND_UI handler will be automatically enabled.

When this data member is set, menu items are automatically enabled in the same way that toolbar buttons are enabled.

This data member simplifies the implementation of optional commands based on the current selection and reduces the need for an application to write ON_UPDATE_COMMAND_UI handlers for enabling and disabling menu items.

Example

CMainFrame::CMainFrame()
{
   // Set to FALSE so no ON_UPDATE_COMMAND_UI or
   // ON_COMMAND handlers are needed, and
   // CMenu::EnableMenuItem() will work as expected.
   m_bAutoMenuEnable  = FALSE;
}

CFrameWnd OverviewClass MembersHierarchy Chart

See Also   CCmdUI, CCmdTarget