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. How to Select a row in CListCtrl at run time ??

How to Select a row in CListCtrl at run time ??

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
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.
  • A Offline
    A Offline
    Ariel
    wrote on last edited by
    #1

    Hi there, I'm trying to Select a row in a CListCtrl using the CListCtrl::SetSelectionMark(idxSel); and i'm calling this method in OnInitDialog() of a CPropertyPage. But this dosen't really worked for me !! I tried to Use UpdateData() and Invalidate() on the view to see if this will help but still no selection seen on the screen (although i do think there is something selected but not shown). Can somone help me with that ???? Thanks alot, Ariel.

    M 1 Reply Last reply
    0
    • A Ariel

      Hi there, I'm trying to Select a row in a CListCtrl using the CListCtrl::SetSelectionMark(idxSel); and i'm calling this method in OnInitDialog() of a CPropertyPage. But this dosen't really worked for me !! I tried to Use UpdateData() and Invalidate() on the view to see if this will help but still no selection seen on the screen (although i do think there is something selected but not shown). Can somone help me with that ???? Thanks alot, Ariel.

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

      Use CListCtrl::SetItemState() instead. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.

      A 1 Reply Last reply
      0
      • M Michael Dunn

        Use CListCtrl::SetItemState() instead. --Mike-- http://home.inreach.com/mdunn/ The preferred snack of 4 out of 5 Lounge readers.

        A Offline
        A Offline
        Ariel
        wrote on last edited by
        #3

        Thanks alot it worked Ariel.

        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