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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to color the background of a row in list control

How to color the background of a row in list control

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
6 Posts 5 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.
  • 1 Offline
    1 Offline
    12Code
    wrote on last edited by
    #1

    I have a dialog which consists of 2 list control items set in report view. I wish to color a row in one of the list control. How can i do it? I can do it, if the app is Single Doc with base class CListView, by using OnCustomDraw. But how can i implement OnCustomDraw in one of the List Control from dialog?

    ;)*12Code

    N H S M 4 Replies Last reply
    0
    • 1 12Code

      I have a dialog which consists of 2 list control items set in report view. I wish to color a row in one of the list control. How can i do it? I can do it, if the app is Single Doc with base class CListView, by using OnCustomDraw. But how can i implement OnCustomDraw in one of the List Control from dialog?

      ;)*12Code

      N Offline
      N Offline
      Nuri Ismail
      wrote on last edited by
      #2

      Here is an example with dialog, see the CUSTLIST.ZIP sample:[^]. Nuri

      1 1 Reply Last reply
      0
      • 1 12Code

        I have a dialog which consists of 2 list control items set in report view. I wish to color a row in one of the list control. How can i do it? I can do it, if the app is Single Doc with base class CListView, by using OnCustomDraw. But how can i implement OnCustomDraw in one of the List Control from dialog?

        ;)*12Code

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        See [here](http://www.codeproject.com/KB/list/xlistctrl.aspx -)[[^](http://www.codeproject.com/KB/list/xlistctrl.aspx - "New Window")].

        Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )

        1 Reply Last reply
        0
        • 1 12Code

          I have a dialog which consists of 2 list control items set in report view. I wish to color a row in one of the list control. How can i do it? I can do it, if the app is Single Doc with base class CListView, by using OnCustomDraw. But how can i implement OnCustomDraw in one of the List Control from dialog?

          ;)*12Code

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Derive a class from the list control (CListCtrl) and implement the custom draw functionality in that. Then, in the dialog class, use your class derived from the list control instead of CListCtrl when declaring the list control variables. The way MFC works, your derived class should sub-class the list controls and you should get your row colouring functionality.

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          1 Reply Last reply
          0
          • N Nuri Ismail

            Here is an example with dialog, see the CUSTLIST.ZIP sample:[^]. Nuri

            1 Offline
            1 Offline
            12Code
            wrote on last edited by
            #5

            Thanks Nuri, This is what i've been looking for. :thumbsup:

            ;)*12Code

            1 Reply Last reply
            0
            • 1 12Code

              I have a dialog which consists of 2 list control items set in report view. I wish to color a row in one of the list control. How can i do it? I can do it, if the app is Single Doc with base class CListView, by using OnCustomDraw. But how can i implement OnCustomDraw in one of the List Control from dialog?

              ;)*12Code

              M Offline
              M Offline
              Michael Dunn
              wrote on last edited by
              #6

              See Neat Stuff to Do in List Controls Using Custom Draw[^]

              --Mike-- New sig under construction...

              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