Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Changing ListCtrl Headers color

Changing ListCtrl Headers color

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RuiSantiago
    wrote on last edited by
    #1

    Hi, i'm working on the desing of my application and i would like to have my ListCtrls Headers in blue instead of the windows gray, how can i change it? I checked the SetColumn function with the struct _LVCOLUMN, but i don't fit to my intents, should i use a appropriate class for the effect, maybe derived from CHeaderCtrl? Thank you in advance

    T 1 Reply Last reply
    0
    • R RuiSantiago

      Hi, i'm working on the desing of my application and i would like to have my ListCtrls Headers in blue instead of the windows gray, how can i change it? I checked the SetColumn function with the struct _LVCOLUMN, but i don't fit to my intents, should i use a appropriate class for the effect, maybe derived from CHeaderCtrl? Thank you in advance

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Header controls support custom draw. This is your chance... Tomasz Sowinski -- http://www.shooltz.com

      What is "scratch" and why can everything be made from it?

      R 1 Reply Last reply
      0
      • T Tomasz Sowinski

        Header controls support custom draw. This is your chance... Tomasz Sowinski -- http://www.shooltz.com

        What is "scratch" and why can everything be made from it?

        R Offline
        R Offline
        RuiSantiago
        wrote on last edited by
        #3

        Well, thank you Tomasz but, i'm kind of new using ListCtrls and to VC++, how exactly should i do this?

        T 2 Replies Last reply
        0
        • R RuiSantiago

          Well, thank you Tomasz but, i'm kind of new using ListCtrls and to VC++, how exactly should i do this?

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          You'll need to handle NM_CUSTOMDRAW notification for header control. For a start, check articles in listview section of CP - they demonstrate how to use custom draw for list itself. I've searched the articles for example of custom-drawn header, but it seems there aren't any yet. Tomasz Sowinski -- http://www.shooltz.com

          What is "scratch" and why can everything be made from it?

          1 Reply Last reply
          0
          • R RuiSantiago

            Well, thank you Tomasz but, i'm kind of new using ListCtrls and to VC++, how exactly should i do this?

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            BTW: there's another technique you could use - owner draw. In this case, you'd have to subclass the header control and override the CHeaderCtrl::DrawItem method. Tomasz Sowinski -- http://www.shooltz.com

            What is "scratch" and why can everything be made from it?

            R 1 Reply Last reply
            0
            • T Tomasz Sowinski

              BTW: there's another technique you could use - owner draw. In this case, you'd have to subclass the header control and override the CHeaderCtrl::DrawItem method. Tomasz Sowinski -- http://www.shooltz.com

              What is "scratch" and why can everything be made from it?

              R Offline
              R Offline
              RuiSantiago
              wrote on last edited by
              #6

              I was out to luch, i'll try those, thank you very much

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups