Re: ListView Selection Bar Color

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu