CToolBarCtrl::Create

BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );

Return Value

Nonzero if successful; otherwise zero.

Parameters

dwStyle

Specifies the toolbar control’s style. Toolbars must always have the WS_CHILD style. In addition, you can specify any combination of toolbar styles and window styles as described under Remarks.

rect

Optionally specifies the toolbar control’s size and position. It can be either a CRect object or a RECT structure.

pParentWnd

Specifies the toolbar control’s parent window. It must not be NULL.

nID

Specifies the toolbar control’s ID.

Remarks

You construct a CToolBarCtrl in two steps. First call the constructor, then call Create, which creates the toolbar control and attaches it to the CToolBarCtrl object.

The toolbar control automatically sets the size and position of the toolbar window. The height is based on the height of the buttons in the toolbar. The width is the same as the width of the parent window’s client area. The CCS_TOP and CCS_BOTTOM styles determine whether the toolbar is positioned along the top or bottom of the client area. By default, a toolbar has the CCS_TOP style.

Apply the following window styles to a toolbar control.

Next, you may want to apply one or more of the common control styles:

Finally, apply a combination of toolbar styles to either the control or the buttons themselves. The styles are described in the topic Toolbar Control and Button Styles in the Platform SDK.

CToolBarCtrl OverviewClass MembersHierarchy Chart

See Also   CToolBarCtrl::CToolBarCtrl, CToolBarCtrl::SetButtonStructSize