CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: Can we use CHeaderCtrl directly?

    Quote Originally Posted by VictorN View Post
    No, the header control in the list control with the LVS_REPORT style is always a child of list control window, not a dialog, nor formview. Just use Spy++ and you will see it.
    Sorry, that is not true for a seperate CHeaderCtrl as requested by the OP. The CListCtrl has an embedded CHeaderCtrl which you can see in Spy. But when you intend to have a separete header for that list control, spreadsheet, tree or what ever you 'usually' make the dialog or formview parent of this header control. I've made already two MFC projects where this design has been applied.

    Se also younger docs like in http://msdn.microsoft.com/en-us/libr...(v=VS.80).aspx

    Also note that of course you may use any CWnd created before as parent for a header control. But a dialog and formview (or a customized list control) surely are better candidates as they already provide a working message map and a proper initial function that was called after the window and child windows were created and before the window initially was displayed.

  2. #17
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Can we use CHeaderCtrl directly?

    Quote Originally Posted by itsmeandnobodyelse View Post
    Quote Originally Posted by VictorN View Post
    No, the header control in the list control with the LVS_REPORT style is always a child of list control window, not a dialog, nor formview. Just use Spy++ and you will see it.
    ...
    It may be a child of a dialog as well as of any other window.
    Sorry, that is not true for a seperate CHeaderCtrl as requested by the OP. The CListCtrl has an embedded CHeaderCtrl which you can see in Spy.
    What is "not true"?
    Do you read only some small parts of my posts?
    Note, that you have confirmed what I wrote in your next sentence after your "that is not true"!

    Well, I suggest you to close our discussion and more carefully read the posts of the guys here.
    Good luck.
    Victor Nijegorodov

  3. #18
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: Can we use CHeaderCtrl directly?

    It is not true that CHeaderCtrl is always a child of CListCtrl, not of dialog and formview.

    If you meant with this that CListCtrl always has an embedded CHeaderCtrl as child window, it is not how I read that (and I don't understand the 'not of dialog and formview' trailer, nor the remark about MSDN you made before, if you meant it that way). In any case it doesn't seem a reason for me to getting rude as neither you or me seem to be a native speaker.

  4. #19
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Can we use CHeaderCtrl directly?

    Quote Originally Posted by itsmeandnobodyelse View Post
    It is not true that CHeaderCtrl is always a child of CListCtrl, not of dialog and formview.
    Then please, give us an example of a standard CListCtrl with the LVS_REPPORT style, which header control is a child of the dialog or formview.
    Victor Nijegorodov

  5. #20
    Join Date
    Oct 2009
    Posts
    577

    Smile Re: Can we use CHeaderCtrl directly?

    Quote Originally Posted by VictorN View Post
    Then please, give us an example of a standard CListCtrl with the LVS_REPPORT style, which header control is a child of the dialog or formview.
    The OP's question is to 'use a header control directly' what in my opinion means not to use the embedded header control of the list control but a second one. That is also the alternative MS describes in the docs and they recommend a view based class for the alternative. I will show an example of such a separate header control associated with a list control and the embedded header control disabled if the OP is interested to that. I would make the parent window a CDockablePane but it seems that it is a new class of VS2010 while I have only VS2008 available.

  6. #21
    Join Date
    Jan 2011
    Posts
    26

    Re: Can we use CHeaderCtrl directly?

    I was too scare to continue with this discussion and start to get myself confuse as I just a newbie.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured