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. Select a row in List control with code?

Select a row in List control with code?

Scheduled Pinned Locked Moved C / C++ / MFC
question
6 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.
  • L Offline
    L Offline
    ldsdbomber
    wrote on last edited by
    #1

    I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue. cheers

    D M 2 Replies Last reply
    0
    • L ldsdbomber

      I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue. cheers

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      ldsdbomber wrote:

      ...but would just like to know the correct method to programmatically set a row to be selected...

      Use the LVM_SETITEM message.


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      L 1 Reply Last reply
      0
      • D David Crow

        ldsdbomber wrote:

        ...but would just like to know the correct method to programmatically set a row to be selected...

        Use the LVM_SETITEM message.


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        L Offline
        L Offline
        ldsdbomber
        wrote on last edited by
        #3

        Is that via a SendMessage David? I've not used that before very much

        D M 2 Replies Last reply
        0
        • L ldsdbomber

          Is that via a SendMessage David? I've not used that before very much

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          ldsdbomber wrote:

          Is that via a SendMessage David?

          Yes, if you are not using MFC.


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          • L ldsdbomber

            Is that via a SendMessage David? I've not used that before very much

            M Offline
            M Offline
            Max Santos
            wrote on last edited by
            #5

            You can use: SetItemState(index,LVIS_SELECTED | LVIS_FOCUSED,LVIS_SELECTED | LVIS_FOCUSED);

            http://xwega.com

            1 Reply Last reply
            0
            • L ldsdbomber

              I've got the complete row selection extended style working now, but would just like to know the correct method to programmatically set a row to be selected as though a user had clicked it so that it can be turned all blue. cheers

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

              4.10 How do I programmatically select an item in a list view control?[^]

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.

              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