共用方式為


CToolBarCtrl::GetItemRect

Retrieves the bounding rectangle of a button in a toolbar control.

BOOL GetItemRect(
   int nIndex,
   LPRECT lpRect 
) const;

Parameters

  • nIndex
    Zero-based index of the button for which to retrieve information.

  • lpRect
    Address of a RECT structure or a CRect object that receives the coordinates of the bounding rectangle.

Return Value

Nonzero if successful; otherwise zero.

Remarks

This function does not retrieve the bounding rectangle for buttons whose state is set to TBSTATE_HIDDEN.

Requirements

Header: afxcmn.h

See Also

Concepts

CToolBarCtrl Class

CToolBarCtrl Members

Hierarchy Chart

CToolBarCtrl::GetButton

CToolBarCtrl::GetButtonCount

CToolBarCtrl::GetState

CToolBarCtrl::SetButtonSize

CToolBarCtrl::SetBitmapSize