views:

757

answers:

1

Hi guys,

Does anyone have any ideas on how I can remove the focus rectangle from a silverlight textbox? (I'm talking about the blue rectangle that appears when you click on the texblock to start typing)

I'm looking through the default style and template for the textbox but can't seem to figure out which element to tweak.

Thanks!

+1  A: 

In the template you will find a border called FocusVisualElement. In the base and Unfocused Visual State it has an opacity of 0%. In the focused Visual state it has 100% opacity. You can simply delete the FocusVisualElement if you doen't want any border indicating the focus.

This probably looks weird when the MouseOverBorder still appears so you might want to delete that to from the Template, however move the ContentElement it holds to the parent Grid first.

Alternatively you could have the Opacity to 0% for these borders in all states.

AnthonyWJones