Re: ListView Selection Bar Color
- Posted by Al Getz <Xaxo at aol.com> Dec 06, 2005
- 573 views
CChris wrote: > > Al Getz wrote: > > > > C Bouzy wrote: > > > > > > No one knows how to do this? > > > > > > C Bouzy wrote: > > > > > > > > Does anyone know how to set the color of a ListView selection bar color? > > > > I know > > > > it can be done without creating an owner drawn control, but I am not > > > > 100% sure > > > > how. > > > > I am using Win32Lib.... > > > > > > > > > ----If you continue to do what you have always done, > > > you will get what you have always gotten.---- > > > > Hello there, > > > > I searched the MS site and couldnt find anything on changing the > > selection bar color. It's possible there is no way to do this > > without going to an owner drawn style. > > > > > > Take care, > > Al > > > > And, good luck with your Euphoria programming! > > > > My bumper sticker: "I brake for LED's" > > > I didn't try it, but: > The color of a highlighted item in a control is a system color whose > identifier > is COLOR_HILIGHT. Using SetSysColor() (in the Window API), and passing it > this index into the system palette and the new desired color, you'll obtain > > what you wish, well almost. > > Almost, because the changes will be visible next time your control is painted > > again. > > Almost, because all windows visible at the time of the call will be affected. > The M$ doc recommends calling SetSysColor() whe the app window is maximised, > > for this reason. You can circumvent this by trapping WM_SYSCOLORCHANGE to let > > only your app know about it. > > Almost, because you must take care to save and restore the modified system > color when your app gains/loses focus. Otherwise, the results could be ... > interesting. > > I forgot to mention that the above applies to ay of the systel colors you can > > get by GetSysColors(). > > HTH > CChris Hi there, I've always found it strange what Windows API "Lets" you change and what it doesnt. It's like someone has to sit down one day and say: "ok, we wont let them change the color of this because we dont think it should change and what we think is better than what anybody else thinks". Strange too, because somewhere in the system dll it has to do: color=GetSystemColor(x) to get the color. One more stinky little function call: SetBarColor(color) and you could set the bar color of any control that has a selection bar, but noooo that would be too good :) Are they afraid someone will set it to the same color as the text and then the text wont be visible? I could think of a million other ways to screw up an app and they havent been afraid of that, and they sure weren't afraid of hackers when surfing with IE he he. Perhaps in Windows9000 op sys you'll be able to do it :) Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"