469,935 Members | 1,728 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,935 developers. It's quick & easy.

ListView - Items with non default ForeColor loose their coloringwhen selecting nothing?

I have a list view and a button that turns the currently selected item's
ForeColor to SystemColors.GrayText

The problem I'm having is that when the user clicks in white space, the
item becomes deselected and the ForeColor turns black (even though it's
still set to GrayText - stepped through to see if it was the case). If
I select a different item instead of selecting nothing the color stays
gray..

What would be causing this? Here's my code for turning the color gray:

private void btn_Delete_Click(object sender, System.EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
listView1.SelectedItems[0].ForeColor = SystemColors.GrayText;
}
}
Nov 20 '05 #1
0 1086

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Paddy | last post: by
2 posts views Thread by David Anderson | last post: by
3 posts views Thread by Mahesh Kumar | last post: by
1 post views Thread by Lars Netzel | last post: by
3 posts views Thread by Steve Long | last post: by
1 post views Thread by Mike Johnson | last post: by
5 posts views Thread by Jure Bogataj | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.