Board index » delphi » Changing Delphi Color Constant ?

Changing Delphi Color Constant ?


2007-04-29 04:42:48 PM
delphi39
Hi to all
how can i change the value of the Delphi graphic color constants
(clBtnShadow,clBtnFace,....).
i saw a compnent in the old version of the jvcl (i think in v2) that let
to change all the value of all constants but this one is moved from the
new versions !!!
anu one please can give me a solution or a link to a compenent similar
to the old jvcl one ?
thanks
 
 

Re:Changing Delphi Color Constant ?

Jo Black writes:
Quote
Hi to all

how can i change the value of the Delphi graphic color constants
(clBtnShadow,clBtnFace,....). i saw a compnent in the old version of
the jvcl (i think in v2) that let to change all the value of all
constants but this one is moved from the new versions !!!
These specific constants map to system colors, so the user can change
them in the display settings dialog if themes are not enabled. You
should not try to modify these colors at compile-time, that makes no
sense. And they are not yours to change at run-time either, since any
such change does not only affect your application but all of them. See
SetSysColors in the MS platform SDK docs.
--
Peter Below (TeamB)
Don't be a vampire (slash7.com/pages/vampires),
use the newsgroup archives :
www.tamaracka.com/search.htm
groups.google.com
 

Re:Changing Delphi Color Constant ?

Peter Below (TeamB) a écrit :
Quote
Jo Black writes:

>Hi to all
>
>how can i change the value of the Delphi graphic color constants
>(clBtnShadow,clBtnFace,....). i saw a compnent in the old version of
>the jvcl (i think in v2) that let to change all the value of all
>constants but this one is moved from the new versions !!!

These specific constants map to system colors, so the user can change
them in the display settings dialog if themes are not enabled. You
should not try to modify these colors at compile-time, that makes no
sense. And they are not yours to change at run-time either, since any
such change does not only affect your application but all of them. See
SetSysColors in the MS platform SDK docs.

Thanks Peter, it works well
 

Re:Changing Delphi Color Constant ?

Hi,
Bit related question, does anyone how to convert a color like clWindow color
to it is RGB values? I have some components that only accept RGB values but I
want them to match the form color for instance at application startup.
-----
Wim van der Vegt
 

Re:Changing Delphi Color Constant ?

Hi,
Found it!
ColorToRGB accepts both 'normal' and 'system' colors and returns RGB values.
-----
Wim van der Vegt
"G.W. van der Vegt" <XXXX@XXXXX.COM>writes
Quote
Hi,

Bit related question, does anyone how to convert a color like clWindow
color to it is RGB values? I have some components that only accept RGB
values but I want them to match the form color for instance at application
startup.

-----
Wim van der Vegt