[Lazarus] How to obtain the "real" color of a control @runtime?

Vojtěch Čihák vojtech.cihak at atlas.cz
Mon Dec 22 23:08:51 CET 2014


Hi,
 
just tested on Qt. My TEdits are also white.
 
This line:
 
writeln(ColorToString(Edit1.Brush.Color));
 
writes out clWindow for default color (clDefault) and clRed for clRed.
 
Vojtěch 
______________________________________________________________
> Od: Bart <bartjunk64 at gmail.com>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 22.12.2014 18:51
> Předmět: [Lazarus] How to obtain the "real" color of a control @runtime?
>
Hi,

I'm trying to obtain the "real" color of a control (TEdit) at runtime.
The color at design time is set to clDefault ($20000000), but I need
to get the RGB value (which in this case should be $FFFFFF, since with
the current theme the default color of a TEdit on my OS is white).
I need this s I can have another control paint in that same color on
it's canvas.

ColorToRGB just gave me $0, whic is not what I'm looking for.

Any hints?

Bart

--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141222/acc58521/attachment-0003.html>


More information about the Lazarus mailing list