Selecting entire row in Listview? 
Author Message
 Selecting entire row in Listview?

Hi all,

Has anyone managed to select an entire Listview row in Win95
(using VB5.0-SP2)?

I am using the following code:

Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" _
  (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long,_
   ByVal lParam As Long) As Long

Public Const LVM_SETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 54)
Public Const LVM_GETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 55)
Public Const LVS_EX_FULLROWSELECT = &H20

Dim rStyle As Long, r As Long
rStyle = SendMessageByNum(lvCompSongs.hwnd,
LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
rStyle = rStyle Or LVS_EX_FULLROWSELECT
r = SendMessageByNum(lvCompSongs.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&,
rStyle)
rStyle = SendMessageByNum(lvCompSongs.hwnd,
LVM_GETEXTENDEDLISTVIEWSTYLE, 0&,0&)

It simply won't work!!!!!

Steve Kent
===========================================================

 / DSTO \       Air Operations Division
 \_.--._/       Aeronautical & Maritime Research Laboratory
       v        Defence Science & Technology Organisation
===========================================================



Fri, 28 Apr 2000 03:00:00 GMT  
 Selecting entire row in Listview?

Take a look at this site (topic Code Library)
http://home.sprynet.com/sprynet/rasanen/vbnet/default.htm

Regards,
Kenneth.

Quote:

>Hi all,

>Has anyone managed to select an entire Listview row in Win95
>(using VB5.0-SP2)?

>I am using the following code:

>Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" _
>  (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long,_
>   ByVal lParam As Long) As Long

>Public Const LVM_SETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 54)
>Public Const LVM_GETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 55)
>Public Const LVS_EX_FULLROWSELECT = &H20

>Dim rStyle As Long, r As Long
>rStyle = SendMessageByNum(lvCompSongs.hwnd,
>LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
>rStyle = rStyle Or LVS_EX_FULLROWSELECT
>r = SendMessageByNum(lvCompSongs.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0&,
>rStyle)
>rStyle = SendMessageByNum(lvCompSongs.hwnd,
>LVM_GETEXTENDEDLISTVIEWSTYLE, 0&,0&)

>It simply won't work!!!!!

>Steve Kent
>===========================================================

> / DSTO \       Air Operations Division
> \_.--._/       Aeronautical & Maritime Research Laboratory
>       v       Defence Science & Technology Organisation
>===========================================================



Fri, 28 Apr 2000 03:00:00 GMT  
 Selecting entire row in Listview?

Quote:

>Hi all,

>Has anyone managed to select an entire Listview row in Win95
>(using VB5.0-SP2)?

Yes I have and it works fine for me. Basically I think you forgot the
declaration for LMV_FIRST (see adjusted code below)

Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" _
 (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
 ByVal lParam As Long) As Long

Public Const LVM_FIRST = &H1000
Public Const LVM_SETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 54)
Public Const LVM_GETEXTENDEDLISTVIEWSTYLE = (LVM_FIRST + 55)
Public Const LVS_EX_FULLROWSELECT = &H20

Dim rStyle As Long, r As Long

rStyle = SendMessageByNum(lvCompSongs.hwnd, _
 LVM_GETEXTENDEDLISTVIEWSTYLE, 0&, 0&)
rStyle = rStyle Or LVS_EX_FULLROWSELECT
r = SendMessageByNum(lvCompSongs.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, _
 0&, rStyle)

It should work now

Quote:

>Steve Kent
>===========================================================

> / DSTO \       Air Operations Division
> \_.--._/       Aeronautical & Maritime Research Laboratory
>       v       Defence Science & Technology Organisation
>===========================================================

Lea Johnson


Fri, 28 Apr 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to select entire row in ListView ?

2. Select entire row in ListView

3. How to select entire row in Listview

4. How to select entire row in ListView ? - FullRowSelect

5. How to select entire row in ListView ?

6. How to select entire row in listview control (VB5)

7. Select entire row in listview control

8. Select entire row in listview control

9. Select entire row in listview control

10. Listview - Selecting an entire row?

11. Listview: Selecting entire row

12. How to select the entire row in a listview using VB6- mscomctl32.ocx

 

 
Powered by phpBB® Forum Software