listview loses highlighted item

  • Thread starter Rich Raffenetti
  • Start date
R

Rich Raffenetti

I have a form with a listview control and a textbox. When I change focus
from the listview to the textbox, the highlighted item on the listview loses
the highlight. That is not the behavior I need.

I am using VB2008 express. I see that the behavior of a similar program in
VB6 is the same.

When the controls are a listbox and a textbox, the highlighted item remains
highlighted when changing focus to the textbox. So I might guess that this
can be done with a listview.

Am I missing something or just out of luck?
 
L

Lloyd Sheen

Rich Raffenetti said:
I have a form with a listview control and a textbox. When I change focus
from the listview to the textbox, the highlighted item on the listview
loses the highlight. That is not the behavior I need.

I am using VB2008 express. I see that the behavior of a similar program
in VB6 is the same.

When the controls are a listbox and a textbox, the highlighted item
remains highlighted when changing focus to the textbox. So I might guess
that this can be done with a listview.

Am I missing something or just out of luck?

Set the HideSelection property of the ListView to false to stop that
behaviour.

Hope this helps
Lloyd Sheen
 
R

Rich Raffenetti

Lloyd Sheen said:
Set the HideSelection property of the ListView to false to stop that
behaviour.

Hope this helps
Lloyd Sheen

Thanks. I really appreciate the reply. Based on the property name, I did
some research and found a sample code at
http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.hideselection(VS.71).aspx

Unfortunately using the HideSelection property doesn't seem to work either
in my application or in the sample code.

All the words describing hideselection are right but false or true, the
result is the same. I tried both VB2008 Express and VB2005 Express.

Anyone able to make this work?
 
R

Rich Raffenetti

Rich Raffenetti said:
Thanks. I really appreciate the reply. Based on the property name, I did
some research and found a sample code at
http://msdn2.microsoft.com/en-us/library/system.windows.forms.listview.hideselection(VS.71).aspx

Unfortunately using the HideSelection property doesn't seem to work either
in my application or in the sample code.

All the words describing hideselection are right but false or true, the
result is the same. I tried both VB2008 Express and VB2005 Express.

Anyone able to make this work?

Reading further I find:

When this property is set to false, selected items in the ListView control
remain highlighted in a different color than the current selection color
specified by the operating system when the ListView control loses focus.

On my screen the "different color" is the same as unhighlighted. In the
display appearance settings I find "selected Items" but nothing suggesting a
different selected item color.

Any ideas?
 
L

Lloyd Sheen

Rich Raffenetti said:
Reading further I find:

When this property is set to false, selected items in the ListView control
remain highlighted in a different color than the current selection color
specified by the operating system when the ListView control loses focus.

On my screen the "different color" is the same as unhighlighted. In the
display appearance settings I find "selected Items" but nothing suggesting
a different selected item color.

Any ideas?

Are you using Vista and Aero? If so the difference is most likely hard to
see.

LS
 
R

Rich Raffenetti

Rich Raffenetti said:
If there is a difference. I am using XP.
There is a difference. The highlight is very light and is even invisible
unless I look at my LCD screen from an angle (not directly). So your advice
was right on. Only the result is not as good as might be expected. Thanks
again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top