Hello,
I have a ListView control in Details view. When an item is un-checked, I
want to change the ForeColor.
The only way I have found to do this is to loop through all the items of the
ListView in its Click, DoubleClick, and KeyPress events using the sub below
. However, the ListView can potentially hold hundreds of items, so this
would be quite slow.
Is there a better way to handle when an item is checked/un-checked?
Thank you,
Eric
\\\
Private Sub HandleCheckChange()
Dim item As ListViewItem
For Each item In lvwDirectories.Items
If item.Checked Then
item.ForeColor = SystemColors.WindowText
Else
item.ForeColor = SystemColors.GrayText
End If
Next
End Sub
///