Highlighting a Entire row in list view with Report view as its style 
Author Message
 Highlighting a Entire row in list view with Report view as its style

Hi folks

I have seen lots of sample in VC++ to do this. Has any of you tried
implementing the following.

Highlighting the entire row in a list view when its style is Reportview.

Any idea on how to do this.

TIA

Karthik



Sat, 23 Dec 2000 03:00:00 GMT  
 Highlighting a Entire row in list view with Report view as its style
Karthik,

Quote:
>Highlighting the entire row in a list view when its style is Reportview.

>Any idea on how to do this.

Yeah, the code follows. Note, however, that this code does not work on the
original version of the common controls. All users using programs that
implement this code need a newer version of them.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

<<<<<<<<<<<<<<<<<<

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal Msg 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 Form_Load()
    Dim i As Integer
    Dim itm As ListItem
    Dim dwStyle As Long

    'Report view
    ListView1.View = lvwReport
    'Add a couple of columns
    ListView1.ColumnHeaders.Add , , "Column 1"
    ListView1.ColumnHeaders.Add , , "Column 2"
    ListView1.ColumnHeaders.Add , , "Column 3"
    'Add some data to the list
    For i = 1 To 100
        Set itm = ListView1.ListItems.Add(, , "This is item " & CStr(i))
        itm.SubItems(1) = "More data"
        itm.SubItems(2) = "Still more data"
    Next i
    'Get current list view style
    dwStyle = SendMessage(ListView1.hwnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0,
ByVal 0&)
    'Set full row select style bit
    dwStyle = dwStyle Or LVS_EX_FULLROWSELECT
    'Set new list view style
    SendMessage ListView1.hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ByVal
dwStyle
End Sub



Sat, 23 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. List View Doesn't Highlight Entire Row?

2. Highlighting Entire ListView Line in Report View (VB4)

3. Highlighting the entire row in a list view when its style is Reportview.

4. Display Bitmaps in Sub Items and column Headers of List View During Report View

5. Select or highlight a whole row in ListView lvwReport View

6. Highlight all columns of a list view?

7. Highlight items in List view

8. Need OE-list style view control.....

9. extended styles in VB 5 list view control

10. List View Top Item in Large Icon View

11. ListView Report View whole line highlight

12. tree view and list view..

 

 
Powered by phpBB® Forum Software