ComCtl32 Header Control

Header Control Demonstration

This article provides a fully-featured Header Control directly from COMCTL32.DLL. The latest version uniquely provides support for Outlook-style drag-drop grouping of columns as well as in place column filtering.

It is a good building block for generating your own controls. Check out the S-Grid project to see the control in use in an all-VB grid control (new version with auto-grouping coming end of April!)

Features of the Header Control

  • Outlook-style grouping of columns:
    Starting a group

    Starting a group

    Adding another columm to the
group

    Adding another column to a group

  • In place filtering of columns with filter text boxes and buttons. The code for this feature can be extracted and applied to ComCtl32 ListView controls too.
  • Drag-drop reordering of columns.
  • ImageList support allowing an icon to be displayed to the right or left of a header.
  • Mouse-over highlighting of column headers ("Hot Tracking").
  • Full set of header events: column left and right clicks, divider double clicks and drag-drop. You can prevent columns from being resized, dragged and restrict widths the user can choose.
  • Set whether the control has buttons or not (like in RegEdit) at run-time.
  • Set alignment of header columns left, right or centre.
  • Full Unicode implementation under NT.