|
-
Mar 18th, 2002, 01:48 PM
#1
Thread Starter
Frenzied Member
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
-
Mar 18th, 2002, 02:18 PM
#2
PowerPoster
right click on the control. It's n there
-
Mar 18th, 2002, 03:32 PM
#3
Thread Starter
Frenzied Member
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
-
Mar 18th, 2002, 03:36 PM
#4
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:
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
Private Const LVM_FIRST = &H1000
Private Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
Private Const LVS_EX_FULLROWSELECT = &H20
Private Sub SetFullRowSelection(ByVal hWndListView, ByVal bFullRow As Boolean)
SendMessage hWndListView, VM_SETEXTENDEDLISTVIEWSTYLE, _
LVS_EX_FULLROWSELECT, ByVal CLng(bFullRow))
End Sub
'This is an example of how you can use this routine:
' enable full row selecting
SetFullRowSelection ListView1.hwnd, True
' disable full row selecting
SetFullRowSelection ListView1.hwnd, False
-
Mar 18th, 2002, 05:20 PM
#5
Thread Starter
Frenzied Member
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..
-
Mar 18th, 2002, 05:33 PM
#6
PowerPoster
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.
-
Mar 18th, 2002, 05:35 PM
#7
PowerPoster
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.

-
Mar 18th, 2002, 05:37 PM
#8
PowerPoster
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?
-
Mar 18th, 2002, 05:47 PM
#9
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).
-
Mar 18th, 2002, 05:58 PM
#10
Thread Starter
Frenzied Member
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
-
Mar 18th, 2002, 06:00 PM
#11
PowerPoster
Thanks, but I found that already when I went searching for SP6. It's downloading as I type.
-
May 9th, 2021, 03:42 AM
#12
New Member
Re: ListView full row select?
 Originally Posted by Hack
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:
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
Private Const LVM_FIRST = &H1000
Private Const LVM_SETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 54
Private Const LVM_GETEXTENDEDLISTVIEWSTYLE = LVM_FIRST + 55
Private Const LVS_EX_FULLROWSELECT = &H20
Private Sub SetFullRowSelection(ByVal hWndListView, ByVal bFullRow As Boolean)
SendMessage hWndListView, VM_SETEXTENDEDLISTVIEWSTYLE, _
LVS_EX_FULLROWSELECT, ByVal CLng(bFullRow))
End Sub
'This is an example of how you can use this routine:
' enable full row selecting
SetFullRowSelection ListView1.hwnd, True
' disable full row selecting
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|