Freigeben über


CReBarCtrl::SetBandInfo

Implements the behavior of the Win32 message RB_SETBANDINFO, as described in the Windows SDK.

BOOL SetBandInfo(
   UINT uBand,
   REBARBANDINFO* prbbi 
);

Parameters

  • uBand
    Zero-based index of the band to receive the new settings.

  • prbbi
    Pointer to a REBARBANDINFO structure that defines the band to be inserted. You must set the cbSize member of this structure to sizeof(REBARBANDINFO) before sending this message.

Return Value

Nonzero if successful; otherwise zero.

Example

int nCount = m_wndReBar.GetReBarCtrl().GetBandCount();
CString strText;
REBARBANDINFO rbbi = {0};
rbbi.cbSize = sizeof(rbbi);
for (int i = 0; i < nCount; i++)
{
   strText.Format(_T("Band #: %d"), i);
   rbbi.lpText = strText.GetBuffer();
   rbbi.cch = strText.GetLength() + 1;
   rbbi.fMask = RBBIM_TEXT;

   m_wndReBar.GetReBarCtrl().SetBandInfo(i, &rbbi);

   strText.ReleaseBuffer();
}   

Requirements

Header: afxcmn.h

See Also

Concepts

CReBarCtrl Class

CReBarCtrl Members

Hierarchy Chart

CReBarCtrl::GetBandInfo