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

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Oct 21 09:25:27 CEST 2011


On 2011-10-20 17:57, Felipe Monteiro de Carvalho wrote:
> 
> I have my TCDPageControl on top of a form, but for
> TCDPageControl.Color I get just clDefault, which turns out to be
> black. =( using Parent.GetDefaultColor(dcBrush) also returned black in
> Windows...

In fpGUI have have a fpgColorToRGBColor() - this will lookup and
translate (if required) "color aliases" to real RGB values. If memory
serves me right, Delphi (and probably Lazarus too) has a similar call?
Try something like ColorToRGB(CDPageControl1.Color) and see if that does
the trick.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/





More information about the Lazarus mailing list