共用方式為


CToolBar::CommandToIndex

This member function returns the index of the first toolbar button, starting at position 0, whose command ID matches nIDFind.

int CommandToIndex(
   UINT nIDFind 
) const;

Parameters

  • nIDFind
    Command ID of a toolbar button.

Return Value

The index of the button, or –1 if no button has the given command ID.

Requirements

Header: afxext.h

See Also

Concepts

CToolBar Class

CToolBar Members

Hierarchy Chart

CToolBar::GetItemID