Dela via


CMFCReBar::AddBar

Adds a band to a rebar.

BOOL AddBar(
    CWnd* pBar,
    LPCTSTR pszText = NULL,
    CBitmap* pbmp = NULL,
    DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP 
);
BOOL AddBar(
    CWnd* pBar,
    COLORREF clrFore,
    COLORREF clrBack,
    LPCTSTR pszText = NULL,
    DWORD dwStyle = RBBS_GRIPPERALWAYS 
);

Parameters

  • [in] [out] pBar
    A pointer to the child window that is to be inserted into the rebar. The referenced object must have the WS_CHILD window style.

  • [in] pszText
    Specifies the text to appear on the rebar. The text is not part of the child window. Rather, it is displayed on the rebar itself.

  • [in] [out] pbmp
    Specifies the bitmap to be displayed on the rebar background.

  • [in] dwStyle
    Contains the style to apply to the band. For a complete list of band styles, see the description for fStyle in the REBARBANDINFO structure in the Windows SDK documentation.

  • [in] clrFore
    Represents the foreground color of the rebar.

  • [in] clrBack
    Represents the background color of the rebar.

Return Value

TRUE if the band was successfully added to the rebar; otherwise, FALSE.

Requirements

Header: afxRebar.h

See Also

Concepts

MFC Hierarchy Chart

Reference

CMFCReBar Class