I want to change the
backcolor of a listViewDataItem, then later on, change it back to the standard
color (ie white if it's not selected or the standard selection color of it's
selected).
I'm using this code to change the backcolor:
previewedListItem.BackColor = Color.Gold
previewedListItem.BackColor2 = Color.Gold
previewedListItem.BackColor3 = Color.Gold
previewedListItem.BackColor4 = Color.Gold
and this code to change it back:
previewedListItem.BackColor = Color.FromArgb(0, 0, 0, 0)
previewedListItem.BackColor2 = Color.FromArgb(0, 0, 0, 0)
previewedListItem.BackColor3 = Color.FromArgb(0, 0, 0, 0)
previewedListItem.BackColor4 = Color.FromArgb(0, 0, 0, 0)
The problem is that once I've changed it back, if the user selects that item,
it stays white instead of showing the selection color. How can I change the
color back in a way that will still show the selection color if the item is
selected?
backcolor of a listViewDataItem, then later on, change it back to the standard
color (ie white if it's not selected or the standard selection color of it's
selected).
I'm using this code to change the backcolor:
previewedListItem.BackColor = Color.Gold
previewedListItem.BackColor2 = Color.Gold
previewedListItem.BackColor3 = Color.Gold
previewedListItem.BackColor4 = Color.Gold
and this code to change it back:
previewedListItem.BackColor = Color.FromArgb(0, 0, 0, 0)
previewedListItem.BackColor2 = Color.FromArgb(0, 0, 0, 0)
previewedListItem.BackColor3 = Color.FromArgb(0, 0, 0, 0)
previewedListItem.BackColor4 = Color.FromArgb(0, 0, 0, 0)
The problem is that once I've changed it back, if the user selects that item,
it stays white instead of showing the selection color. How can I change the
color back in a way that will still show the selection color if the item is
selected?