Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27347

VS 2010 [RESOLVED] Listview subitem forecolor based on Text value

$
0
0
Hi to all,
I have several columns in a listview some of which contain numeric values.
I want that if a subitem value is less than 10 then its forecolor be red.
I have set
.UseItemStyleForSubItems = False
and no luck.

with LV
For Each lvi As ListViewItem In .Items
For j As Integer = 0 To .Columns.Count - 1
If j = 3 Then
lvi.SubItems(j).BackColor = Color.Blue 'entire column backcolor is blue This is OK
'I have tried the following but no success
if lvi.SubItems(j).text>=0 andalso lvi.SubItems(j).text<10 then
lvi.SubItems(j).foreColor = Color.red 'this fails
end if
End If
next
end with

Viewing all articles
Browse latest Browse all 27347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>