If you have ever used a CHeader the first thing you notice that it isn't
as nice as the one that appears at the top of list controls. What I mean
by this is that when you resize the control
all you get is a resizing line. When you move this line the header
does not update its items
as it moves only at the end when you release the button. With
a CListCtrl the headers continuously update as they move.
This functionality is cool and would be nice to have in a standard CHeader
control.
Following is the procedure by which you can add this functionality
to your own CHeader derived classes. All you need to do is override
a couple of the mouse procedures and you are in business.
An Avi of how it works:
Comments
Some useful undocumented header styles
Posted by Legacy on 04/14/2000 12:00amOriginally posted by: Matthew Shovelton
I've just been playing about with CHeaderCtrls and, through scanning the MFC header files, have discovered 3 undocumented styles (HDS_* codes). One of them produces the behaviour described in the above article. The styles are:
HDS_FULLDRAG - Dynamically updates the header control as you resize it. It sends HDN_ITEMCHANGING and HDN_ITEMCHANGED notifications as you resize, so trap these instead of HDN_TRACK.
HDS_DRAGDROP - Allows drag and drop movement of header items
HDS_HOTTRACK - Highlights header items as you move the cursor over the header.
Hope you find this useful.
-
ReplyTrapping the messages
Posted by mpirooz on 06/30/2008 03:41pmThe best way I've discovered to accomplish this is to set the LRESULT* passed into the reflect functions to -1.
Reply