Condividi tramite


CReBarCtrl::InsertBand

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

BOOL InsertBand(
   UINT uIndex,
   REBARBANDINFO* prbbi 
);

Parameters

  • uIndex
    Zero-based index of the location where the band will be inserted. If you set this parameter to -1, the control will add the new band at the last location.

  • prbbi
    A 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 calling this function.

Return Value

Nonzero if successful; otherwise zero.

Example

REBARBANDINFO rbbi = {0};
rbbi.cbSize = sizeof(rbbi);

TCHAR szText[80];
rbbi.lpText = szText;
rbbi.cch = sizeof(szText) / sizeof(szText[0]);

rbbi.fMask = RBBIM_BACKGROUND | RBBIM_CHILD |
    RBBIM_CHILDSIZE | RBBIM_COLORS | RBBIM_HEADERSIZE |
    RBBIM_IDEALSIZE | RBBIM_ID | RBBIM_IMAGE |
    RBBIM_LPARAM | RBBIM_SIZE | RBBIM_STYLE | RBBIM_TEXT;

m_wndReBar.GetReBarCtrl().GetBandInfo(0, &rbbi);

m_wndReBar.GetReBarCtrl().InsertBand(1, &rbbi);      

Requirements

Header: afxcmn.h

See Also

Reference

CReBarCtrl Class

Hierarchy Chart

Other Resources

CReBarCtrl Members