CMFCReBar Class
A CMFCReBar object is a control bar that provides layout, persistence, and state information for rebar controls.
class CMFCReBar : public CPane
Members
Public Methods
Name |
Description |
---|---|
Adds a band to a rebar. |
|
(Overrides CBasePane::CalcFixedLayout.) |
|
(Overrides CBasePane::CanFloat.) |
|
Creates the rebar control and attaches it to the CMFCReBar object. |
|
(Overrides CBasePane::EnableDocking.) |
|
|
|
Provides direct access to the underlying CReBarCtrl common control. |
|
(Overrides CPane::OnShowControlBarMenu.) |
|
(Overrides CWnd::OnToolHitTest.) |
|
(Overrides CBasePane::OnUpdateCmdUI.) |
|
(Overrides CBasePane::SetPaneAlignment.) |
Remarks
A CMFCReBar object can contain a variety of child windows. This includes edit boxes, toolbars, and list boxes. You can resize the rebar programmatically, or the user can manually resize the rebar by dragging its gripper bar. You can also set the background of a rebar object to a bitmap of your choice.
A rebar object behaves similarly to a toolbar object. A rebar control can contain one or more bands, and each band can contain a gripper bar, a bitmap, a text label, and a child window.
Example
The following example demonstrates how to use various methods in the CMFCReBar class. The example shows how to create a rebar control and add a band to it. The band functions as an internal toolbar. This code snippet is part of the Rebar Test sample.
CMFCReBar m_wndReBar;
...
// Each rebar pane will ocupy its own row:
DWORD dwStyle = RBBS_GRIPPERALWAYS | RBBS_FIXEDBMP | RBBS_BREAK;
// CMFCMenuBar m_wndMenuBar
// CMFCToolBar m_wndToolBar
if (!m_wndReBar.Create(this) ||
!m_wndReBar.AddBar (&m_wndMenuBar) ||
!m_wndReBar.AddBar (&m_wndToolBar, NULL, NULL, dwStyle))
{
TRACE0("Failed to create rebar\n");
return -1; // fail to create
}
Inheritance Hierarchy
Requirements
Header: afxRebar.h