[Lazarus] How to obtain the color of a component?

Paul Ishenin ip at kmiac.ru
Fri Oct 21 10:19:30 CEST 2011


21.10.2011 16:01, Felipe Monteiro de Carvalho пишет:
> On Fri, Oct 21, 2011 at 9:47 AM, Paul Ishenin<ip at kmiac.ru>  wrote:
>    if CDTabControl.Color = clDefault then
>      lColor := CDTabControl.GetDefaultColor(dctBrush)<-- I get black!
>    else lColor := ColorToRGB(CDTabControl.Color);

The call to CDTabControl.GetDefaultColor(dctBrush) can return a system 
color too, so there is the same need to ColorToRGB() for this case.

if CDTabControl.Color = clDefault then
   lColor := ColorToRGB(CDTabControl.GetDefaultColor(dctBrush))
else
   lColor := ColorToRGB(CDTabControl.Color);

This should work ^.

Best regards,
Paul Ishenin.





More information about the Lazarus mailing list