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. CListCtrl - Selected Item

CListCtrl - Selected Item

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 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
    RadioOpa
    wrote on last edited by
    #1

    I use a CListCtrl object that, by default, should display Item No. 0 as selected. The Item ist displayed with a light grey background, when I click on an item is is displayed with a much darker background. How can I change the light grey to dark grey ? m_Companies.SetItemState( 0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED); m_Companies.EnsureVisible( 0, FALSE);

    I 1 Reply Last reply
    0
    • R RadioOpa

      I use a CListCtrl object that, by default, should display Item No. 0 as selected. The Item ist displayed with a light grey background, when I click on an item is is displayed with a much darker background. How can I change the light grey to dark grey ? m_Companies.SetItemState( 0, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED); m_Companies.EnsureVisible( 0, FALSE);

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      if the item gets light gray but not dark gray, it means CListCtrl doesn't get focus. use: myList.SetFocus() to set focus on the CListCtrl.


      A nice tool for optimizing your Microsoft html-help contents. Includeh10

      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