Dim
Dim

Reputation: 4807

Disable TAB navigation in entire application

How can I disable tab navigation in my WPF application? Or maybe just remove that dotted box around selected items. I know there is:

Property="IsTabStop" Value="False"

but I can use in specific items, I wish to disable this for entire app.

Upvotes: 1

Views: 649

Answers (2)

Anatoliy Nikolaev
Anatoliy Nikolaev

Reputation: 22702

If you want just remove that dotted box around elements, try set FocusVisualStyle to null:

<Setter Property="FocusVisualStyle" Value="{x:Null}" />

Or in Control:

<SomeControl FocusVisualStyle="{x:Null}" ... />

Upvotes: 2

GazTheDestroyer
GazTheDestroyer

Reputation: 21241

You could add the following to the resources of your app.xaml

<!-- gets rid of dotted border -->
<Style TargetType="FrameworkElement">
    <Setter Property="FocusVisualStyle" Value="{x:Null}" />
</Style>

<!-- turns off tab stops -->
<Style TargetType="Control">
    <Setter Property="IsTabStop" Value="False" />
</Style>

The question is why would you want to do this for the entire app? Many people use tabbing for navigation, especially people using accessibility software.

Upvotes: 2

Related Questions