Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there a way to change the color of the column in a list view instead of the whole row changing color? I have a 3 column listview and I would like the 3rd column to be a dark green but when I use the following code it is changing the whole row instead of just the one subitem.

 

           Dim i As Integer
           For i = 0 To ListView1.Items.Count - 1
               If CInt(ListView1.Items(i).SubItems(1).Text) = 0 Then
                   ListView1.Items(i).SubItems(0).ForeColor = Color.Green
               End If
           Next

 

I tried changing the SubItems(0) to SubItems(2) but then the code doesnt work at all.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...