共用方式為


CMFCToolBar::GetButtonInfo

Returns the command ID, style, and image index of the button at a specified index.

void GetButtonInfo(
   int nIndex,
   UINT& nID,
   UINT& nStyle,
   int& iImage 
) const;

Parameters

  • [in] nIndex
    Specifies the index of the button in the list of buttons on the toolbar.

  • [out] nID
    The command ID of a button.

  • [out] nStyle
    The style of the button.

  • [out] iImage
    The index of the image for the button.

Remarks

The GetButtonInfo method finds a toolbar button at the specified index and retrieves the command ID, style and image index of the button.

If the button at the specified index does not exist, the framework sets nID and nStyle to 0, and iImage to -1 when the method returns.

Requirements

Header: afxtoolbar.h

See Also

Reference

CMFCToolBar Class

Hierarchy Chart