次の方法で共有


Creating a Rebar Control

 

The latest version of this topic can be found at Creating a Rebar Control.

CReBarCtrl](../Topic/CReBarCtrl%20Class.md) objects should be created before the parent object is visible. This minimizes the possibilities of painting problems.

For instance, rebar controls (used in frame window objects) are commonly used as parent windows for toolbar controls. Therefore, the parent of the rebar control is the frame window object. Because the frame window object is the parent, the OnCreate member function (of the parent) is an excellent place to create the rebar control.

To use a CReBarCtrl object, you will typically follow these steps:

To use a CReBarCtrl object

  1. Construct the CReBarCtrl object.

  2. Call Create to create the Windows rebar common control and attach it to the CReBarCtrl object, specifying any desired styles.

  3. Load a bitmap, with a call to CBitmap::LoadBitmap, to be used as the background of the rebar control object.

  4. Create and initialize any child window objects (toolbars, dialog controls, and so on) that will be contained by the rebar control object.

  5. Initialize a REBARBANDINFO structure with the necessary information for the band about to be inserted.

  6. Call InsertBand to insert existing child windows (such as m_wndReToolBar) into the new rebar control. For more information on inserting bands into an existing rebar control, see Rebar Controls and Bands.

See Also

Using CReBarCtrl
Controls