how's that done?
I have :
to change the color of the text in the first column, but how do I change the color of the text in the other columns?Code:Listview.ListItems(3).ForeColor = vbRed
Printable View
how's that done?
I have :
to change the color of the text in the first column, but how do I change the color of the text in the other columns?Code:Listview.ListItems(3).ForeColor = vbRed
anyone, anyone?
Code:Option Explicit
Private Sub Form_Load()
Dim i As Integer ' Counter
Dim j As Integer ' Counter for ListSubItems
Dim sngWidth As Single
Dim si As ListSubItem
Dim li As ListItem
' You can't see ColumnHeaders or ListSubitems
' unless the View is set to lvwReport.
ListView1.View = lvwReport
' Calculate the width of a ColumnHeader object.
sngWidth = ListView1.Width / 5
' Create five ColumnHeader objects.
For i = 1 To 5
ListView1.ColumnHeaders.Add Text:="Col " & i, Width:=sngWidth
Next i
' Create twenty ListItem objects. For each ListItem, create four
' ListSubItem objects. Set the ForeColor for each object to red.
For i = 1 To 20
Set li = ListView1.ListItems.Add(Text:="Item " & i)
For j = 1 To 4
Set si = li.ListSubItems.Add(Text:="Subitem " & j)
li.ForeColor = vbBlue
si.ForeColor = vbRed
Next j
Next i
End Sub