Sorry about the description, I'm not sure exactly what the damn thing is called. I want to hide the 'dotted line' that appears around WPF elements when tabbing.
On one customers machine the selection border is mysteriously (and randomly) appearing around buttons and even around some images in a Uniform Grid that I can't even select via tabbing. They are even appearing on elements that are set to hidden which is very strange, I thought the customer was mistaken until I got the screenshots.
I have a custom skin for everything already so hopefully the selection border is available as attribute I can set to transparent?
that was basicaly what I was seeing. In my case it would only show on a customers machine and behave on all others.
Did you try the suggested fix? Because that seems to have cured the problem in my case (I have had a report back that its stopped doing it anyway!).
I am not sure if setting FocusVisualStyle to null is the perfect solution. Wouldn't the user still have to tab through the control (but without a visual indication that the control has focus)?
There's a UIElement.Focusable property that should be used to specify whether you want an element to receive keyboard focus or not. The default value for the Focusable property is dependent on the particular control, but most subclasses of Control will have Focusable=true as default.
So, to disable the dotted rectangle around an element (and to remove its ability to receive keyboard focus) you do something like this:
<Grid Focusable="False" />