I have a StackPanel with some Buttons in it. I want the StackPanel to be semi-transparent, but the buttons to remain opaque. I've been googling for a while but still can't figure this out. I can find solutions for having opaque controls on a semi-transparent window, but not for opaque controls on a semi-transparent control.
When you say semi-transparent StackPanel, you certainly mean the StackPanel's Background
. You can always set that to a Brush with an Opacity less than 1. In case of a solid-color background, that would be a SolidColorBrush:
<StackPanel>
<StackPanel.Background>
<SolidColorBrush Color="Red" Opacity=".5"/>
</StackPanel.Background>
...
</StackPanel>
or you simply use a color with an appropriate alpha value:
<StackPanel Background="#7FFF0000">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With