CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2005
    Posts
    1,030

    LVCFMT_CENTER doesn't work for first column in CListCtrl

    I called InsertColumn to insert columns and use LVCFMT_CENTER to set the text to the center of the column. It works well for any columns except the first column. Is there any way to get around this issue? Thanks.

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

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Yes, it is by design. See the Remarks section in LVCOLUMN structure article.

    PS: it is always very useful to read the documentation first...
    Last edited by VictorN; April 19th, 2012 at 12:51 AM.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2009
    Posts
    596

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Quote Originally Posted by VictorN View Post
    Yes, it is by design. See the Rearks section in LVCOLUMN structure article.
    That 'Remarks' section looks less like an explanation that this is by design, and more like a workaround for a bug.

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

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Quote Originally Posted by Peter_B View Post
    That 'Remarks' section looks less like an explanation that this is by design, and more like a workaround for a bug.
    Wel, it is just a design bug and MSTF lives with it and doesn't want to fix it (as well as many other bugs).
    So we have to accept it as is and just implement one or other workaround...
    Victor Nijegorodov

  5. #5
    Join Date
    Jul 2005
    Posts
    1,030

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Thanks. It works.
    Quote Originally Posted by VictorN View Post
    Yes, it is by design. See the Rearks section in LVCOLUMN structure article.

    PS: it is always very useful to read the documentation first...

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Quote Originally Posted by Peter_B View Post
    That 'Remarks' section looks less like an explanation that this is by design, and more like a workaround for a bug.
    Either way it's documented. Had Larry bothered to read the documentation instead of posting here, he would have found the answer, he would have found it quicker, and Victor wouldn't have had to do his work for him.

    Seriously Larry, after 7 years here, you should be able to find this stuff yourself.

  7. #7
    Join Date
    Jan 2009
    Posts
    596

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Quote Originally Posted by GCDEF View Post
    Either way it's documented.
    Oh, I absolutely agree. In fact, the remarks sections are extremely important to read as they are where the unusual/unexpected behaviour tends to be documented.

    My point was really that this remarks section seems to indicate that this behaviour wasn't originally explicitly designed, but was later documented to avoid having to fix a bug (which could cause existing code to break).

  8. #8
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: LVCFMT_CENTER doesn't work for first column in CListCtrl

    Quote Originally Posted by Peter_B View Post
    Oh, I absolutely agree. In fact, the remarks sections are extremely important to read as they are where the unusual/unexpected behaviour tends to be documented.

    My point was really that this remarks section seems to indicate that this behaviour wasn't originally explicitly designed, but was later documented to avoid having to fix a bug (which could cause existing code to break).
    I know. My point was mainly directed to Larry and others that use this site instead of using the documentation. This guy's started 231 threads. Not really my concern I guess but that seems a bit high.

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