Menu opacity
-
Hey, Is there a way to change the opacity of the background of a menu? I want to set the opacity of one to 0.5. I tried setting the opacity to 0.5, but this also makes the text on the menu items half transparent. Setting the opacity of the menu items to 1 does not change that. is there a way to achieve the result I desire? I've got a temporary fix, but I'm not happy with it - I'm still looking for a better solution.
<Menu Grid.ColumnSpan="3" Name="menuBg" Opacity="0.42" /> <Menu Grid.ColumnSpan="3" Name="mainMenu" Background="Transparent">
Cheers!Jeroen De Dauw --- Forums ; Blog ; Wiki --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
-
Hey, Is there a way to change the opacity of the background of a menu? I want to set the opacity of one to 0.5. I tried setting the opacity to 0.5, but this also makes the text on the menu items half transparent. Setting the opacity of the menu items to 1 does not change that. is there a way to achieve the result I desire? I've got a temporary fix, but I'm not happy with it - I'm still looking for a better solution.
<Menu Grid.ColumnSpan="3" Name="menuBg" Opacity="0.42" /> <Menu Grid.ColumnSpan="3" Name="mainMenu" Background="Transparent">
Cheers!Jeroen De Dauw --- Forums ; Blog ; Wiki --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!
You can set the background to a semitransparent color using ARGB (alpha, red, green, blue):
<Menu Background="#22FFFFFF">
<MenuItem Header="Hello"></MenuItem>
</Menu>Also, the background need not be a single color. There are various brushes you can play around with to paint whatever you want:
<Menu>
<Menu.Background>
<LinearGradientBrush>
<GradientStop Offset="0" Color="#00000000" />
<GradientStop Offset="0.9" Color="#FF000000" />
</LinearGradientBrush>
</Menu.Background>
<MenuItem Header="Hello"></MenuItem>
</Menu> -
You can set the background to a semitransparent color using ARGB (alpha, red, green, blue):
<Menu Background="#22FFFFFF">
<MenuItem Header="Hello"></MenuItem>
</Menu>Also, the background need not be a single color. There are various brushes you can play around with to paint whatever you want:
<Menu>
<Menu.Background>
<LinearGradientBrush>
<GradientStop Offset="0" Color="#00000000" />
<GradientStop Offset="0.9" Color="#FF000000" />
</LinearGradientBrush>
</Menu.Background>
<MenuItem Header="Hello"></MenuItem>
</Menu>