|  | 
| How to make CXTHeaderCtr::DrawItem() be called? | 
| Post Reply   | 
| Author | |
| amzheng   Newbie     Joined: 05 June 2008 Location: Canada Status: Offline Points: 4 |  Post Options  Thanks(0)  Quote  Reply  Topic: How to make CXTHeaderCtr::DrawItem() be called? Posted: 05 June 2008 at 1:22pm | 
| I have a class derived from MFC class CHeaderCtrl with DrawItem() function overrided.  Now I use CXTHeaderCtrl instead of CHeaderCtrl, and then my DrawItem() function is not being called anymore. Thanks in advance. | |
| 
     Emily
     | |
|  | |
| Oleg   Senior Member   Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |  Post Options  Thanks(0)  Quote  Reply  Posted: 06 June 2008 at 1:15am | 
| 
   Hello,
 Its not called from CXTHeaderCtrl. to support custom themes CXTHeaderCtrl catch WM_PAINT and draw all header manually. See XTHeaderCtrlTheme.cpp file - you can derive from CXTHeaderCtrlTheme and override some methods. | |
| 
     Oleg, Support Team CODEJOCK SOFTWARE SOLUTIONS | |
|  | |
| amzheng   Newbie     Joined: 05 June 2008 Location: Canada Status: Offline Points: 4 |  Post Options  Thanks(0)  Quote  Reply  Posted: 06 June 2008 at 7:00pm | 
| 
   I create a small program following your idea. Yeah, override some draw function of CXTHeaderCtrlTheme make it works. Thanks a lot, Oleg.
 | |
| 
     Emily
     | |
|  | |
| amzheng   Newbie     Joined: 05 June 2008 Location: Canada Status: Offline Points: 4 |  Post Options  Thanks(0)  Quote  Reply  Posted: 09 June 2008 at 5:08pm | 
| 
   I made an override function of CXTHeaderCtrlTheme::DrawHeader(), now it works fine. But there is a problem, when I right click on my header column, it always pop up a menu, it has "Sort Ascending", "Sort Descending" and "Alignment" with submenus, even if I did not create this menu. I want to get rid of this popup menu, and put my popup menu there, how can I get rid of this menu? Thanks in advance.
    | |
| 
     Emily
     | |
|  | |
| amzheng   Newbie     Joined: 05 June 2008 Location: Canada Status: Offline Points: 4 |  Post Options  Thanks(0)  Quote  Reply  Posted: 09 June 2008 at 7:32pm | 
| 
   I've solved it. Thanks.
    | |
| 
     Emily
     | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |