Freigeben über


CMFCDropDownToolbarButton::CMFCDropDownToolbarButton

Constructs a CMFCDropDownToolbarButton object.

CMFCDropDownToolbarButton();
CMFCDropDownToolbarButton(
   LPCTSTR lpszName,
   CMFCDropDownToolBar* pToolBar 
);

Parameters

  • [in] lpszName
    The default text of the button.

  • [in] pToolBar
    A pointer to the CMFCDropDownToolBar object that is displayed when the user presses the button.

Remarks

The second overload of the constructor copies to the drop-down button the first button from the toolbar that pToolBar specifies.

Typically, a drop-down toolbar button uses the text from the most recently used button in the toolbar that pToolBar specifies. It uses the text specified by lpszName when the button is converted to a menu button or is displayed in the Commands tab of the Customize dialog box. For more information about the Customize dialog box, see CMFCToolBarsCustomizeDialog Class.

Example

The following example demonstrates how to construct an object of the CMFCDropDownToolbarButton class. This code snippet is part of the Visual Studio Demo sample.

    // Add dropdown resources button
    // CMFCToolBarsCustomizeDialog* pDlgCust
    // CMFCDropDownToolBar m_wndToolbarResource
    pDlgCust->AddButton(_T("Build"), CMFCDropDownToolbarButton(_T("Add Resource"), &m_wndToolbarResource));

Requirements

Header: afxdropdowntoolbar.h

See Also

Reference

CMFCDropDownToolbarButton Class

Hierarchy Chart

CMFCDropDownToolBar Class

CMFCToolBarsCustomizeDialog Class