CReBarCtrl 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
m_wndReToolBar
) into the new rebar control. For more information on inserting bands into an existing rebar control, see Rebar Controls and Bands.