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. Can CListCtrl select all the row (not only the iSubItem=0 part)?

Can CListCtrl select all the row (not only the iSubItem=0 part)?

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 3 Posters 1 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

    Is there a way a CListCtrl in ReportView mode will select all the row when selecting one and not only the first iSubItem ??? Waht i mean is that when selecting rows in Report view mode only the first column of this row is selected. I want to be able to select all the row (all the SubItems) in the same click on the row. Can this be done ? Thanks in advance, Ariel.

    D J 2 Replies Last reply
    0
    • A Ariel

      Is there a way a CListCtrl in ReportView mode will select all the row when selecting one and not only the first iSubItem ??? Waht i mean is that when selecting rows in Report view mode only the first column of this row is selected. I want to be able to select all the row (all the SubItems) in the same click on the row. Can this be done ? Thanks in advance, Ariel.

      D Offline
      D Offline
      Daniel Ferguson
      wrote on last edited by
      #2

      Yes, you can select the whole row.

      //set extended list view styles
      DWORD dwStyle = pList->SendMessage( LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0 );
      dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
      pList->SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle );

      Daniel "das leid schlaft in der maschine" -Einstürzende Neubauten

      A 1 Reply Last reply
      0
      • A Ariel

        Is there a way a CListCtrl in ReportView mode will select all the row when selecting one and not only the first iSubItem ??? Waht i mean is that when selecting rows in Report view mode only the first column of this row is selected. I want to be able to select all the row (all the SubItems) in the same click on the row. Can this be done ? Thanks in advance, Ariel.

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

        You can do it Daniel's way or, // Set the listview style. Add features that you like. List.SetExtendedStyle ( m_fList.GetExtendedStyle() | LVS_EX_FULLROWSELECT // Select all items when clicked | LVS_EX_GRIDLINES // Draw gridlines. I like them. | LVS_EX_TRACKSELECT // Hover if you wish etc. ); Probably both the same. The secret is the Extended Style business. I'm just passing on what I was told on this site. And it works too.

        A 1 Reply Last reply
        0
        • J Joe Moldovan

          You can do it Daniel's way or, // Set the listview style. Add features that you like. List.SetExtendedStyle ( m_fList.GetExtendedStyle() | LVS_EX_FULLROWSELECT // Select all items when clicked | LVS_EX_GRIDLINES // Draw gridlines. I like them. | LVS_EX_TRACKSELECT // Hover if you wish etc. ); Probably both the same. The secret is the Extended Style business. I'm just passing on what I was told on this site. And it works too.

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

          Hi there, First, Thanks alot for the answer it was really helpful and it have a nice view this way. The only thing i don't understand whats the : "| LVS_EX_TRACKSELECT // Hover" ? If you can tell me that too i'll be very thankfull, Ariel.

          J 1 Reply Last reply
          0
          • A Ariel

            Hi there, First, Thanks alot for the answer it was really helpful and it have a nice view this way. The only thing i don't understand whats the : "| LVS_EX_TRACKSELECT // Hover" ? If you can tell me that too i'll be very thankfull, Ariel.

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

            Look up "Extended list view styles" in the Visual Studio help index. You can do a lot of interesting things in a list view control. LVS_EX_TRACKSELECT Version 4.70. Enables hot-track selection in a list view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with a LVM_SETHOVERTIME message. This style applies to all styles of list view control. You can check whether or not hot-track selection is enabled by calling SystemParametersInfo.

            A 1 Reply Last reply
            0
            • J Joe Moldovan

              Look up "Extended list view styles" in the Visual Studio help index. You can do a lot of interesting things in a list view control. LVS_EX_TRACKSELECT Version 4.70. Enables hot-track selection in a list view control. Hot track selection means that an item is automatically selected when the cursor remains over the item for a certain period of time. The delay can be changed from the default system setting with a LVM_SETHOVERTIME message. This style applies to all styles of list view control. You can check whether or not hot-track selection is enabled by calling SystemParametersInfo.

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

              Thats Great - Thank you very much i really apritiate all the help. Ariel.

              1 Reply Last reply
              0
              • D Daniel Ferguson

                Yes, you can select the whole row.

                //set extended list view styles
                DWORD dwStyle = pList->SendMessage( LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0 );
                dwStyle = dwStyle | LVS_EX_FULLROWSELECT;
                pList->SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle );

                Daniel "das leid schlaft in der maschine" -Einstürzende Neubauten

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

                Hi there, Thanks alot you saved me alot of time till i would have figured this out. Thanks Again, 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