Results 1 to 12 of 12

Thread: ListView full row select?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    ListView full row select?

    I could've sworn there was a way to enable a full row select in the VB ListView? Or am I just going crazy? I can't seem to find the property to set...

    Any help would be appreciated..

    Dan

    Visual Studio 2010

  2. #2
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    right click on the control. It's n there

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Wow, that's weird. I just got home for lunch and get your reply and sure enough, there is an option that says "Full Row Select". However, I swear it wasn't there at work, but I'll double check when I get back to work today.

    Is it possible that an older version of the control does not have that option?

    Any help would be appreciated..

    Dan

    Visual Studio 2010

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    It didn't know you could do that either. Wow. I always coded it using SendMessage (but then, I've been accused of being API Happy...)
    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2.  
    3. Private Const LVM_FIRST = &H1000
    4. Private Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
    5. Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
    6. Private Const LVS_EX_FULLROWSELECT = &H20
    7.  
    8. Private Sub SetFullRowSelection(ByVal hWndListView, ByVal bFullRow As Boolean)
    9.    SendMessage hWndListView, VM_SETEXTENDEDLISTVIEWSTYLE, _
    10.        LVS_EX_FULLROWSELECT, ByVal CLng(bFullRow))
    11. End Sub
    12.  
    13. 'This is an example of how you can use this routine:
    14. ' enable full row selecting
    15. SetFullRowSelection ListView1.hwnd, True
    16. ' disable full row selecting
    17. SetFullRowSelection ListView1.hwnd, False

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    Well sure enough, I just got back to work and took a look at the ListView properties by right clicking on it.

    There is no "Full row select" checkbox, as there was at home. Also, it seems like there are much fewer options. Here are the only checkboxes provided, in the order they appear:

    - HideColumnHeaders
    - HideSelection
    - LabelWrap
    - MultiSelect
    - Enabled

    Why the difference? Here is some info about my work and home computers:

    Work:

    - WinNT 4
    - Visual Studio 6 /sp4

    Home

    - WinXP
    - Visual Studio 6 /sp6

    Any ideas? It must be a different version of the ListView but I didn't know they upgraded it..

    Visual Studio 2010

  6. #6
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Different version of mscomctl.ocx? Check the versions on both the ocx files, and see if one is different. It may have different options on NT4, but I wouldn't think so.
    <removed by admin>

  7. #7
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    Notice the sp4 at work and sp6 at home.. there's your answer.

    Install the newest service pack at work.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  8. #8
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Originally posted by Arc
    Notice the sp4 at work and sp6 at home.. there's your answer.

    Install the newest service pack at work.
    I don't think that's the problem. I have SP4 right now, and I do have the checkbox for FullRowSelect. I am on Windows 2000 Pro with VB6 SP4. How do you have SP6? Is it out?
    <removed by admin>

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    The one with less options comes from 'Microsoft Windows Common Controls 5.0' and the one with more comes from 'Microsoft Windows Common Controls 6.0' They have all the same controls but the 5.0 one's controls have less features (with all the controls not just the Listview).

  10. #10

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    DOH!!!

    I can't believe I missed such an obvious thing.. Yes, it was the diffrence between the 5.0 and 6.0 of the Common Controls.

    Thanks a bunch!

    Regarding SP6, I tried to find it on Microsoft.com but could only see SP5, so I may be mistaken.. I will take another look when I get home. Maybe I got it from my MSDN subsription? Anyway, here a link to SP5 if you need it:

    http://msdn.microsoft.com/vstudio/do...p5/default.asp

    Visual Studio 2010

  11. #11
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    Originally posted by dbassettt74
    Anyway, here a link to SP5 if you need it:

    http://msdn.microsoft.com/vstudio/do...p5/default.asp
    Thanks, but I found that already when I went searching for SP6. It's downloading as I type.
    <removed by admin>

  12. #12
    New Member
    Join Date
    May 2020
    Posts
    1

    Thumbs up Re: ListView full row select?

    Quote Originally Posted by Hack View Post
    It didn't know you could do that either. Wow. I always coded it using SendMessage (but then, I've been accused of being API Happy...)
    VB Code:
    1. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    2.  
    3. Private Const LVM_FIRST = &H1000
    4. Private Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
    5. Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
    6. Private Const LVS_EX_FULLROWSELECT = &H20
    7.  
    8. Private Sub SetFullRowSelection(ByVal hWndListView, ByVal bFullRow As Boolean)
    9.    SendMessage hWndListView, VM_SETEXTENDEDLISTVIEWSTYLE, _
    10.        LVS_EX_FULLROWSELECT, ByVal CLng(bFullRow))
    11. End Sub
    12.  
    13. 'This is an example of how you can use this routine:
    14. ' enable full row selecting
    15. SetFullRowSelection ListView1.hwnd, True
    16. ' disable full row selecting
    17. SetFullRowSelection ListView1.hwnd, False
    Perfect Example.. Thanks a lot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width