Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-04

Transparent TPanel reloaded

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Grajcar

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.freepascal.org/pipermail/lazarus/attachments/20160410/3300447f/attachment.html>

Reply by email