Export (0) Print
Expand All

Header Control Styles

Header controls have a number of styles, described in this section, that determine the control's appearance and behavior. You set the initial styles when you create the header control.

ConstantDescription
HDS_BUTTONS

Each item in the control looks and behaves like a push button. This style is useful if an application carries out a task when the user clicks an item in the header control. For example, an application could sort information in the columns differently depending on which item the user clicks.

HDS_DRAGDROP

Version 4.70. Allows drag-and-drop reordering of header items.

HDS_FILTERBAR

Version 5.80. Include a filter bar as part of the standard header control. This bar allows users to conveniently apply a filter to the display. Calls to HDM_LAYOUT will yield a new size for the control and cause the list view to update.

HDS_FLAT

Version 6.0. Causes the header control to be drawn flat when Windows XP is running in classic mode.

Note  Comctl32.dll version 6 is not redistributable but it is included in Windows XP or later. To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.

HDS_FULLDRAG

Version 4.70. Causes the header control to display column contents even while the user resizes a column.

HDS_HIDDEN

Indicates a header control that is intended to be hidden. This style does not hide the control. Instead, when you send the HDM_LAYOUT message to a header control with the HDS_HIDDEN style, the control returns zero in the cy member of the WINDOWPOS structure. You would then hide the control by setting its height to zero. This can be useful when you want to use the control as an information container instead of a visual control.

HDS_HORZ

Creates a header control with a horizontal orientation.

HDS_HOTTRACK

Version 4.70. Enables hot tracking.

HDS_CHECKBOXES

Windows Vista and Version 6.00. Allows the placing of checkboxes on header items. For more information, see the fmt member of HDITEM.

HDS_NOSIZING

Windows Vista and Version 6.00. The user cannot drag the divider on the header control.

HDS_OVERFLOW

Windows Vista and Version 6.00. A button is displayed when not all items can be displayed within the header control's rectangle. When clicked, this button sends an HDN_OVERFLOWCLICK notification.

Remarks

To retrieve and change the styles after creating the control, use the GetWindowLong and SetWindowLong functions.

Requirements

Header

CommCtrl.h

 

 

Community Additions

ADD
Show:
© 2014 Microsoft