By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,855 Members | 2,003 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,855 IT Pros & Developers. It's quick & easy.

ListView

P: n/a
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??
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hello,

"Lou" <lo********@comcast.net> schrieb:
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.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2

P: n/a
Lou
So how does one color just one cell?

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Lou" <lo********@comcast.net> schrieb:
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.

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #3

P: n/a
"Lou" <lo********@comcast.net> schrieb
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.
--
Armin

Nov 20 '05 #4

P: n/a
Hello,

"Lou" <lo********@comcast.net> schrieb:
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?

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5

P: n/a
Hello,

"Armin Zingler" <az*******@freenet.de> schrieb:
Here it doesn't color anything. When setting the
UseItemStyleForSubItems to False, only the backcolor
of the subitem is changed.


Agrrhraaaaa... you are right...

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #6

P: n/a
Hello,

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> schrieb:
[Nonsense]

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

--
Herfried K. Wagner
MVP VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.