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. Selecting list control subitems

Selecting list control subitems

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsontutorialquestion
3 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.
  • J Offline
    J Offline
    Joe Moldovan
    wrote on last edited by
    #1

    I am using an MFC CListCtrl with multiple columns. I have two related problems: 1. I can select an item (column 0) by left or right clicking on it but subitems don't respond when clicked. I would like to pop up a floating menu on any item or subitem when right clicked. 2. There seems to be no way that I can get the control to set the subitem attribute to selected (LVIS_SELECTED) and display blue. I have looked at SetItemState (no good, can't see subitems) and SetItem (does not work, just ignores the status change). Does anyone know how to make this SOB do as it is told and allow me to select a subitem? Has anyone done this without MFC using only the SDK API?

    M 1 Reply Last reply
    0
    • J Joe Moldovan

      I am using an MFC CListCtrl with multiple columns. I have two related problems: 1. I can select an item (column 0) by left or right clicking on it but subitems don't respond when clicked. I would like to pop up a floating menu on any item or subitem when right clicked. 2. There seems to be no way that I can get the control to set the subitem attribute to selected (LVIS_SELECTED) and display blue. I have looked at SetItemState (no good, can't see subitems) and SetItem (does not work, just ignores the status change). Does anyone know how to make this SOB do as it is told and allow me to select a subitem? Has anyone done this without MFC using only the SDK API?

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

      Make this call: yourListCtrl.SetExtendedStyle( yourListCtrl.GetExtendedStyle() | LVS_EX_FULLROWSELECT; Then, clicking anywhere in a row will select the whole row. This requires v4.70+ of the common controls. --Mike-- http://home.inreach.com/mdunn/ Time is an illusion; lunchtime doubly so.

      J 1 Reply Last reply
      0
      • M Michael Dunn

        Make this call: yourListCtrl.SetExtendedStyle( yourListCtrl.GetExtendedStyle() | LVS_EX_FULLROWSELECT; Then, clicking anywhere in a row will select the whole row. This requires v4.70+ of the common controls. --Mike-- http://home.inreach.com/mdunn/ Time is an illusion; lunchtime doubly so.

        J Offline
        J Offline
        Joe Moldovan
        wrote on last edited by
        #3

        A thousand blessings upon you! Works like a charm. (It's all there in the MSDN too. I must be getting old and blind.)

        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