[Lazarus] Transparent TPanel reloaded

Martin Grajcar maaartinus at gmail.com
Sun Apr 10 22:43:06 CEST 2016


I've found quite a few posting regarding a transparent TPanel and somehow
nothing fits. All I need is to place controls on a panel and let it look
like there were directly on its parent. I don't want to create a component
for this.

The panel is colored clDefault and placed on a form colored clDefault, too.
Using ParentColor := TRUE, on Ubuntu 12 with GTK2 the form is $F2F5F7 and
the panel is much darker.

I guess, I finally found a solution, but I don't really understand it:

    BevelInner := bvNone;
    BevelOuter := bvNone;
    Caption := '';
    BorderStyle := bsNone;
    ParentColor := False;
    IF Assigned (Parent) THEN Color := Parent.GetRGBColorResolvingParent;

The final line is funny. I thought, just GetRGBColorResolvingParent should
work, but it doesn't. Any idea?

Regards, Martin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160410/3300447f/attachment-0002.html>


More information about the Lazarus mailing list