Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Share:
Notifications
Clear all

[Solved] Lazarus Pascal - How to get a Transparent TPanel

1 Posts
1 Users
0 Reactions
284 Views
 Hans
(@hans)
Famed Member Admin
Joined: 13 years ago
Posts: 3043
Topic starter  

Sometimes we use a TPanel for layout purposes, and in those cases the Panel should sometimes be transparent.

After having gone through numerous options, I found this to work under macOS/Cocoa (using FPC Trunk);

Originally this only worked under Windows, but it seems to work with Cocoa (with Lazarus 4.99 or newer - I am using trunk)

YourPanel.ControlStyle := YourPanel.ControlStyle - [csOpaque] + [csParentBackground];

 

As it took me quite a while to figure this one out: I hope this is helpful to someone 😊 



   
ReplyQuote
Share: