共用方式為


CMFCToolBar::OnUserToolTip

Called by the framework when the tooltip for a button is about to be displayed.

virtual BOOL OnUserToolTip(
   CMFCToolBarButton* pButton,
   CString& strTTText 
) const;

Parameters

  • [in] pButton
    Points to a toolbar button for which a tooltip is to be displayed.

  • [out] strTTText
    A reference to CString object that receives the text of the tooltip.

Return Value

TRUE if strTTText was populated with tooltip text; otherwise FALSE.

Remarks

The framework calls this method when the tooltip for a toolbar button is about to be displayed. If OnUserToolTip returns TRUE, the framework displays a tooltip which contains the text returned by OnUserToolTip in strTTText. Otherwise, the tooltip contains the button text.

Override OnUserToolTip to customize tool tips of toolbar buttons. The default implementation calls CMFCToolBar::OnUserToolTip to obtain the tooltip text.

Requirements

Header: afxtoolbar.h

See Also

Reference

CMFCToolBar Class

Hierarchy Chart