Dynamically creating my meny in silverlight, I need to make the selected item highlighted
I have a dynamically generated menubar, that is a control that i've built that holds a couple of textblocks, the menuitems is populated dependent on what role you have in the system. My problem now is that I need to开发者_Python百科 make the selected menu item to change looks, so the user can see what tab he's on. Please give me some idees to how I can achieve this.
Without seeing your control it is hard to answer - however I generally find, in simplest terms, that adjusting the Opacity of the control is incredibly helpful. Try setting the Opacity of ALL the menuitems to .8 (80%) by default. Then when an item is pressed (or maybe hovered over) set the Opacity of that item to 1 (100%). You will see it brighten and the color deepen a bit. This makes it obvious that the item is "selected" without having to jump through a lot of hoops. This technique has the added benefit that you can extend it to buttons of different colors or even various images, and it will still "work".
精彩评论