How can I avoid the bluish border when clicking the HyperlinkButton button in Silverlight?

I have a Silverlight menu for my application with a background image. I use the empty HyperlinkButton pool in a certain position and size to simulate a real button on an image (think of it as an image in the form of an HTML map):

<HyperlinkButton x:Name="Portfolio" Width="86" Height="40" Canvas.Top="50" NavigateUri="/portfolio"/> <HyperlinkButton x:Name="Analysis" Width="79" Height="40" Canvas.Top="50" Canvas.Left="124" NavigateUri="/analysis" BorderThickness="0"/> <HyperlinkButton x:Name="News" Width="77" Height="40" Canvas.Top="50" Canvas.Left="240" NavigateUri="/news"/> <HyperlinkButton x:Name="Questions" Width="80" Height="40" Canvas.Top="50" Canvas.Left="357" NavigateUri="/questions"/> <HyperlinkButton x:Name="Companies" Width="80" Height="40" Canvas.Top="50" Canvas.Left="477" NavigateUri="/companies"/> 

The problem is that when I click these buttons, it shows a blue border corresponding to the area of ​​the hyperlink button during the click event. Is there any way to avoid this?

+6
hyperlink silverlight
source share
3 answers

I found the answer on another blog, just set IsTabStop = "False" in the HyperLinkButton instance.

+15
source share

For information about style controls, see http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-7-using-control-templates-to-customize-a-control-s-look-and -feel.aspx (go to the user preferences using the Control Templates section halfway down). If you want to start with the default style (this is usually a good idea - run here and add / change / delete everything until you get what you want) look here: http://msdn.microsoft.com/en-us/library /cc296242(VS.95).aspx .

In this case, I think the culprit is FocusVisualElement. You can change the color, set the visibility to Minimized, or delete / change the Focus state to prevent the storyboard from starting.

+1
source share

You can edit the HyperlinkButton template in Blend: 1. right-click on the control, select "Edit Template-> Change Copy" 2. In the States panel, click "Pressed" 3.change the "Stroke" property of the rectangle with the name "FocusVisualElement from solid to no brush

http://silverlight.net/forums/t/40896.aspx

0
source share

All Articles