Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Menu opacity

Menu opacity

Scheduled Pinned Locked Moved WCF and WF
csscomhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jeroen De Dauw
    wrote on last edited by
    #1

    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!

    A 1 Reply Last reply
    0
    • J Jeroen De Dauw

      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!

      A Offline
      A Offline
      AspDotNetDev
      wrote on last edited by
      #2

      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>

      [Forum Guidelines]

      J 1 Reply Last reply
      0
      • A AspDotNetDev

        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>

        [Forum Guidelines]

        J Offline
        J Offline
        Jeroen De Dauw
        wrote on last edited by
        #3

        Thanks, didn't know you could do that semitransparent stuff :)

        Jeroen De Dauw --- Forums ; Blog ; Wiki --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups