Share via


Creating the Header Control

OverviewSample

The header control is not directly available in the dialog editor (although you can add a list control, which includes a header control). ClassWizard doesn't support adding data members of type CHeaderCtrl.

To put a header control in a dialog box

  1. Manually embed a member variable of type in your dialog class.

  2. In , create and set the styles for the CHeaderCtrl, position it, and display it.

  3. Add items to the header control.

  4. Use ClassWizard to map handler functions in the dialog class for any header-control notification messages you need to handle.

To put a header control in a view (not a CListView)

  1. Embed a object in your view class.

  2. Style, position, and display the header control window in the view's member function.

  3. Add items to the header control.

  4. Use ClassWizard to map handler functions in the view class for any header-control notification messages you need to handle.

In either case, the embedded control object is created when the view or dialog object is created. Then you must call to create the control window. To position the control, call to determine the control's initial size and position and to set the position you want. Then add items as described in Adding Items to the Header Control.

For more information, see in the Platform SDK.

See Also   Windows Common Controls and MFC Classes