[Closed] dotNet ListView selected Items highlight goes from blue to tan
Is there a way to keep the blue highlight after you lose focus of the controller?
I have my hideselection set to false, so it still shows what item is selected, it just switches from a blue to a tan, i believe from my system colors.
My version of the same tool in ActiveX kept the blue high light the whole time, controller in focus, or not in focus.
Has anyone found a work around for this, or am i missing something.
Thanks for your time.
I’d like an answer to this as well… it is related to the system’s colors, since if you switch your Settings (from XP Blue to Silver, or to Windows Classic, etc), it changes. I tried a few things but no cigar.
The only thing that I have done to change this is to colour the background property of the listView item.
Sounds like he wants it the default color so it will not matter. Once focus is lost set te back ground color to the same as the selection color.
dotnet controls like listview and treeview have an ownerdraw property that allows to to pretty much draw the whole control from scratch. Setting this to true allows you to bypass windows drawing the control. You use the drawitem handler to specify background color, text color etc. The handler of this event contains a few useful properties – drawbackground, drawtext and bounds for example (which contains all the info of where the item is and how big it is)
Just to add that for the TreeView the DrawMode property does the same for that control