CHeader Class |
Description
The CHeader class adds support for the header control. A header control is a window that is usually positioned above columns of text or numbers. It contains a title for each column, and it can be divided into parts. The user can drag the dividers that separate the parts to set the width of each column.
Refer to the documentation that ships with the Microsoft Windows Software Development Kit for more information on the use of animation controls.
CHeader Members
Construction |
CHeader();Constructs a header control.
int GetBitmapMargin() const;Gets the width of the bitmap margin for a header control.
HIMAGELIST GetImageList() const;Gets the handle to the image list that has been set for the header control.
BOOL GetItem(int nPos, HDITEM* pHeaderItem) const;Gets information about an item in a header control.
int GetItemCount() const;Gets a count of the items in a header control.
CRect GetItemRect(int nIndex) const;Gets the bounding rectangle for a given item in a header control.
BOOL GetOrderArray(LPINT piArray, int iCount);Gets the current left-to-right order of items in a header control.
int OrderToIndex(int nOrder) const;Retrieves an index value for an item based on its order in the header control.
int SetBitmapMargin(int nWidth);Sets the width of the margin, specified in pixels, of a bitmap in the header control.
HIMAGELIST SetImageList(HIMAGELIST himl);Assigns an image list to the header control.
BOOL SetItem(int nPos, HDITEM* pHeaderItem);Sets the attributes of the specified item in a header control..
BOOL SetOrderArray(int iCount, LPINT piArray);Sets the left-to-right order of header items.
int ClearAllFilters();Clears all of the filters for the header control.
int ClearFilter(int nColumn);Clears the filter for the header control
HIMAGELIST CreateDragImage(int nIndex);Creates a transparent version of an item image within the header control.
BOOL DeleteItem(int nPos);Deletes an item from the header control.
int EditFilter(int nColumn, BOOL bDiscardChanges);Moves the input focus to the edit box when a filter button has the focus.
int InsertItem(int nPos, HDITEM* phdi);Inserts a new item into the header control.
BOOL Layout(HDLAYOUT* pHeaderLayout);Retrieves the correct size and position of the header control within the parent window.
int SetFilterChangeTimeout(DWORD dwTimeOut);Sets the timeout interval between the time a change takes place in the filter attributes and the posting of an
int SetHotDivider(CPoint pt);
int SetHotDivider(int nIndex);Changes the color of a divider between header items to indicate the destination of an external drag-and-drop operation.
virtual void PreRegisterClass(WNDCLASS &wc);Set the window class parameters before the window is created.
Base class Members
For base class members, refer to the members of CWnd.
Remarks
A header control can be created as a child window of another control, such as a list box. However, the parent control is not aware of the header control and does not allow for the space taken up by the header, with the result that list items will appear behind the header. If you wish to use a header control in a list box or other control, the parent control must be owner-drawn so that all items are displayed in the correct position.
List view controls already have header controls. Instead of creating a header
control for a list view, you use
Summary Information
Header file | controls.h |
Win32/64 support | Yes |
WinCE support | Yes |
Library required | Comctl32.lib |