PDA

Click to See Complete Forum and Search --> : Listview subitems hilight and colored


farah
Jul 5th, 1999, 09:59 PM
Hello everyone,

I got the following code from vb help, How can I hilight and make the colomn itmX.SubItems(1) = CStr(myRs!Au_id) in different color like blue? Thanks for your help in advance.


While Not myRs.EOF
Set itmX = ListView1.ListItems. _
Add(, , CStr(myRs!Author)) ' Author.
' If the AuthorID field is not null, then set ' SubItem 1 to it.
If Not IsNull(myRs!Au_id) Then itmX.SubItems(1) = CStr(myRs!Au_id)
End If ' If the birth field is not Null, set ' SubItem 2 to it.
If Not IsNull(myRs![Year Born]) Then
itmX.SubItems(2) = myRs![Year Born] End If
myRs.MoveNext ' Move to next record. Wend

bashfirst
Jul 7th, 1999, 03:00 PM
I don't believe there is any way to color a column/subitem in a list view.... however, for an excellent discussion of adding features to list views, check out this web site http://www.mvps.org/vbnet/
They talk about adding features to list views like sorting by clicking on columnheaders, dragging columns to new locations, etc.

Hope this helps
Bash

farah
Jul 7th, 1999, 09:45 PM
thanks bashfirst for your respond. I got the answer after experimenting alot in listview. here is my answer:
Dim itmX As ListItem
itmX.ListSubItems(1).ForeColor = &HFF&

------------------