Translucent form and opaque roundrect lazarus / 39-Graphics ---------------------------------------------------------------------- xinyiman · 2019-06-14 06:57 Hi guys, I want to understand how to draw an opaque roundrect on a translucent form. I did some tests, but by making the form translucent even the roundrect that I draw in the form2 paint event becomes translucent. Try my test and press the button on the first form. You will understand what I mean. ---------------------------------------------------------------------- Pascal · 2019-06-14 08:57 On windows you can use: SetLayeredWindowAttributes(Handle, clFuchsia, 180, LWA_COLORKEY or LWA_ALPHA); See attached project. ---------------------------------------------------------------------- xinyiman · 2019-06-14 09:03 Quote from: Pascal on June 14, 2019, 10:57:36 amOn windows you can use: SetLayeredWindowAttributes(Handle, clFuchsia, 180, LWA_COLORKEY or LWA_ALPHA); See attached project. Thanks but your solution isn't cross-platform. Run only windows system. ---------------------------------------------------------------------- Pascal · 2019-06-14 09:21 Yes, right. Mybe someone can add a ColorKey property to TForm and uses system specific functions to set it. There should be a Unix/OSX pendant. ---------------------------------------------------------------------- xinyiman · 2019-06-14 09:52 sorry but don't understand ---------------------------------------------------------------------- Pascal · 2019-06-14 10:15 We need a new property for TForm like AlphaBlend and AlphaBlendValue: ColorKey. AlphaBlend and AlphaBlendValue are set in the Windows widgetset by SetLayeredWindowAttributes. SetLayeredWindowAttributes can also set the ColorKey. So for Windows widgetset there is a solution. For other widgetsets there must be an equivalent function to set the ColorKey. If we know them we can add ColorKey property to TForm and will have a cross platform solution! ---------------------------------------------------------------------- xinyiman · 2019-06-14 10:24 AlphaBlend and AlphaBlendValue run correctly on mac but all form and components get transparent value. For me necessity is important form with transparency and component (like a button or image) not. ---------------------------------------------------------------------- Pascal · 2019-06-14 11:37 So my solution doesn't work either. Have a look here: https://stackoverflow.com/questions/4928215/changing-alpha-of-window- background-not-the-whole-window But LCL can't set alpha value of window background color.