CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 1999
    Posts
    26

    Set different color for different columns

    I would like to set the color of the CListCtrl column text to different colors.
    As SetTextColor(blue) will set the entire CListCtrl to blue.(Not the specific column that I want.)
    To summarize of what I want...

    Column1 Column2 Column3
    White Blue Red
    Blue Blue Green

    Please help.....



  2. #2
    Join Date
    May 1999
    Posts
    35

    Re: Set different color for different columns

    Hi,

    if you want to set column or row specific colors you have to use the style LVS_OWNERDRAWFIXED. The overridden member function DrawItem is then called for each item in the list control to be drawn. This member function has to do all the drawings and text printings so you can set the colors you want.

    Greetings, Jörg



  3. #3
    Join Date
    Apr 1999
    Posts
    26

    Re: Set different color for different columns

    Do you have a example code for that purpose?
    Thanks.


  4. #4
    Join Date
    May 1999
    Location
    Canada
    Posts
    36

    Re: Set different color for different columns


  5. #5
    Join Date
    Apr 1999
    Posts
    26

    Re: Set different color for different columns

    I have got it up already actually. but thanks anyway.


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