共用方式為


CMFCVisualManager::OnHighlightMenuItem

The framework calls this method when it draws a highlighted menu item.

virtual void OnHighlightMenuItem(
   CDC* pDC,
   CMFCToolBarMenuButton* pButton,
   CRect rect,
   COLORREF& clrText
);

Parameters

  • [in] pDC
    A pointer to the device context for a menu.

  • [in] pButton
    A pointer to a CMFCToolBarMenuButton object to display. The default implementation does not use this parameter.

  • [in] rect
    A rectangle that specifies the boundaries of the menu item.

  • [in] clrText
    The current text color of highlighted menu items. The default implementation does not use this parameter.

Remarks

The default implementation of this method does not use the parameters pButton or clrText. It fills the rectangle specified by rect with the standard background color.

Override this method in a derived visual manager to customize the appearance of highlighted menu items. Use the clrText parameter to modify the text color of a highlighted menu item.

Requirements

Header: afxvisualmanager.h

See Also

Reference

CMFCVisualManager Class

Hierarchy Chart