ListView

  • Thread starter Thread starter Lou
  • Start date Start date
L

Lou

How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??
 
Hello,

Lou said:
How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??

The 'BackColor' property only works for the first item in the row and will
be used for all items in the row. If you set an other bacckground color for
other items, they will be ignored.
 
Lou said:
How do I get the background color of a single cell to change.
i tried
Dim item1 As New ListViewItem(node_name.InnerText, 1)

item1.SubItems.Item(0).BackColor = vbColor.Red

but that colors the entir row??

Here it doesn't color anything. When setting the UseItemStyleForSubItems to
False, only the backcolor of the subitem is changed.
 
So how does one color just one cell?

Herfried K. Wagner said:
Hello,



The 'BackColor' property only works for the first item in the row and will
be used for all items in the row. If you set an other bacckground color for
other items, they will be ignored.
 
Hello,

Lou said:
So how does one color just one cell?

You will need to draw the items yourself (a custom drawn listview). Are you
very familiar with .NET programming?
 
Hello,

Armin Zingler said:
Here it doesn't color anything. When setting the
UseItemStyleForSubItems to False, only the backcolor
of the subitem is changed.

Agrrhraaaaa... you are right...
 
Hello,

[Nonsense]

Forget this posting. Have a look at Armin's suggestion! Shame on me.
 
Back
Top