I wrote a small WPF control - a textbox displaying small (i) icon allowing to display popup help. The relevant part of the control template looks like the following:
<DockPanel>
<local:InfoIcon DockPanel.Dock="Right" Margin="2" VerticalAlignment="Center" HelpContent="{TemplateBinding InfoTooltip}"
Focusable="False" IsTabStop="False"/>
<ScrollViewer x:Name="PART_ContentHost" Margin="2" VerticalAlignment="Center"/>
</DockPanel>
The InfoIcon
have IsTabStop
and Focusable
explicitly set to false. But that doesn't prevent that control from getting focus while tabbing through controls:
How can I prevent this part of CustomControl from getting focus?
Try setting KeyboardNavigation.TabNavigation="None"
in the DockPanel
or the InfoIcon
itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With