Hi guys.
i am calling the below procedure each time i add a row to the listview.
the way i see it working as that each time something is added then the rows are coloured dependant on the value of a particualr sub item
the code:
the problemCode:Private Sub SetRowItemColours() Dim lvi As ListViewItem = lstJobs.Items(0) For i As Integer = 0 To lstJobs.Items.Count - 1 Step 1 If lvi.SubItems(1).Text = "NA" Then lstJobs.Items(i).ForeColor = Color.Red Else : lstJobs.Items(i).ForeColor = Color.Blue End If Next i End Sub
when i add the first row the colour woks fine
BUT
all the other rows shall remain this forecolor
what am i doing wrong. i believe that i am not looping properly
thanks for any help in advance![]()


Reply With Quote