0

Is there a way to not transfer the opacity of the parent to his childrens (in Delphi/Firemonkey)?

mac
  • 39
  • 3
  • 1
    No. You will have to give up on transparency for the parent or introduce additional common parent layout for parent and move children to that layout. – Dalija Prasnikar Mar 04 '20 at 11:03
  • As you did not say what the parent component is, I can not answer for sure, but take a look at how a similar request was [solved here](https://stackoverflow.com/a/47599821/2292722) by using a `TRectangle`, setting its color to $7FFFFFFF (7F is the alpha channel, half opaque) which allows the `Opacity` property to be set at 1. Thus, even though the rectangle is half translucent, the controls placed on it can be fully opaque. – Tom Brunberg Mar 04 '20 at 12:47
  • Maybe irrelevant, but I think it's interesting that this is essentially the same problem (and Tom's suggestion is essentially the same solution), [as is often asked for CSS](https://stackoverflow.com/questions/5770341/i-do-not-want-to-inherit-the-child-opacity-from-the-parent-in-css). – GolezTrol Mar 04 '20 at 13:21
  • As I don't do CSS, I really don't share Golez's interest in technology similarities with Delphi/Firemonkey – Tom Brunberg Mar 05 '20 at 08:46

0 Answers0