Muokkaa

Jaa


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.

Constant Description
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
Allows drag-and-drop reordering of header items.
HDS_FILTERBAR
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 and later. Causes the header control to be drawn flat when the operating system is running in classic mode.
Note: Comctl32.dll version 6 is not redistributable but it is included in Windows. To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.
HDS_FULLDRAG
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
Enables hot tracking.
HDS_CHECKBOXES
Version 6.00 and later. Allows the placing of checkboxes on header items. For more information, see the fmt member of HDITEM.
HDS_NOSIZING
Version 6.00 and later. The user cannot drag the divider on the header control.
HDS_OVERFLOW
Version 6.00 and later. 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

Requirement Value
Header
CommCtrl.h