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. Highliting items in list control

Highliting items in list control

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 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.
  • S Offline
    S Offline
    Shay Harel
    wrote on last edited by
    #1

    Hi ! Anybody knows how can I highlite a specific line in the list control ? If I try SetBkColor(..) it will do it fot the whole list. I want to highlite just few items ? Thank you !:omg:

    T V 2 Replies Last reply
    0
    • S Shay Harel

      Hi ! Anybody knows how can I highlite a specific line in the list control ? If I try SetBkColor(..) it will do it fot the whole list. I want to highlite just few items ? Thank you !:omg:

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

      SetItemState(itemIndex, LVIS_SELECTED, LVIS_SELECTED); or SetItemState(itemIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); Tomasz Sowinski -- http://www.shooltz.com

      To some its a six-pack, to me it's a support group

      S 1 Reply Last reply
      0
      • T Tomasz Sowinski

        SetItemState(itemIndex, LVIS_SELECTED, LVIS_SELECTED); or SetItemState(itemIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED); Tomasz Sowinski -- http://www.shooltz.com

        To some its a six-pack, to me it's a support group

        S Offline
        S Offline
        Shay Harel
        wrote on last edited by
        #3

        Great, works well

        1 Reply Last reply
        0
        • S Shay Harel

          Hi ! Anybody knows how can I highlite a specific line in the list control ? If I try SetBkColor(..) it will do it fot the whole list. I want to highlite just few items ? Thank you !:omg:

          V Offline
          V Offline
          valikac
          wrote on last edited by
          #4

          You will most likely have to implement a custom draw algorithm for a specific line. Browse the list control section of CodeProject and CodeGuru for examples. Kuphryn

          R 1 Reply Last reply
          0
          • V valikac

            You will most likely have to implement a custom draw algorithm for a specific line. Browse the list control section of CodeProject and CodeGuru for examples. Kuphryn

            R Offline
            R Offline
            Robert Mooney
            wrote on last edited by
            #5

            To enable full row highlighting in a list control: m_ctrlList.SetExtendedStyle(m_ctrlList.GetExtendedStyle() | LVS_EX_FULLROWSELECT); - Rob

            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