listview item loses background color after I change selection

  • Thread starter Thread starter ari
  • Start date Start date
A

ari

I have recently upgraded from vb.net 2002 to 2005, and have
encountered the following problem.

I have a listview with say a dozen items. Following a user action I
programmatically update the background colour of the currently
selected item to red. Lets say in this case it was the 3rd row.

The 3rd row is still the current item, so its still got a blue
background. Now in the past if I scrolled down or clicked on another
row, I would see the 3rd row with a red background, but now I don't -
its white. If I resize the window (which resizes the listview) I
suddenly see the 3rd row with a red background, but if I select it,
and then something else, then it goes back to being white until I
resize again, when it again is red.
 
ari said:
I have recently upgraded from vb.net 2002 to 2005, and have
encountered the following problem.

I have a listview with say a dozen items. Following a user action I
programmatically update the background colour of the currently
selected item to red. Lets say in this case it was the 3rd row.

The 3rd row is still the current item, so its still got a blue
background. Now in the past if I scrolled down or clicked on another
row, I would see the 3rd row with a red background, but now I don't
- its white. If I resize the window (which resizes the listview) I
suddenly see the 3rd row with a red background, but if I select it,
and then something else, then it goes back to being white until I
resize again, when it again is red.

I don't see which problem you have with the VB.Net language. The Treeview is
a .Net Framework component shared by all Framework clients, so the right
place to ask is a Framework group, like
m.p.dotnet.framework.windowsforms.controls.


Armin
 
ari said:
I have recently upgraded from vb.net 2002 to 2005, and have
encountered the following problem.

I have a listview with say a dozen items. Following a user action I
programmatically update the background colour of the currently
selected item to red. Lets say in this case it was the 3rd row.

The 3rd row is still the current item, so its still got a blue
background. Now in the past if I scrolled down or clicked on another
row, I would see the 3rd row with a red background, but now I don't -
its white. If I resize the window (which resizes the listview) I
suddenly see the 3rd row with a red background, but if I select it,
and then something else, then it goes back to being white until I
resize again, when it again is red.

What you are seeing is the selected row color (when you select it).

When it is not selected it will have the background colour you assigned.

Selected colour is set by the user in themes for windows.

LS
 
What you are seeing is the selected row color (when you select it).

When it is not selected it will have the background colour you assigned.

Selected colour is set by the user in themes for windows.

LS

No - the problem is that when it is not selected I am NOT seeing the
background I assigned, I am only seeing white. Only when I resize the
window does it apply the color I assigned.
 
What you are seeing is the selected row color (when you select it).

When it is not selected it will have the background colour you assigned.

Selected colour is set by the user in themes for windows.

LS

No - the problem is that when it is not selected I am NOT seeing the
background I assigned, I am only seeing white. Only when I resize the
window does it apply the color I assigned.


Ok do you have the HideSelection of the control set to True, if so set it to
False
LS
 
No - the problem is that when it is not selected I am NOT seeing the
background I assigned, I am only seeing white. Only when I resize the
window does it apply the color I assigned.

Ok do you have the HideSelection of the control set to True, if so set itto
False
LS- Hide quoted text -

- Show quoted text -

No this wasn't it - but Problem solved! I disabled my graphics
accelerator, and the problem went away.

Thanks for all the help
 
Back
Top