I'm having a really hard time with something that should be trivial. I just want to remove a few buttons from the tab order on a UserControl. I've tried adding IsTabStop="False"
and KeyboardNavigation.IsTabStop="False"
attributes to their xaml declarations, as well as setting myButton.IsTabStop = false;
in the Loaded event handler for the UserControl. None of these additions had any effect, I could still tab to the controls I did this for.
Setting the TabIndex in the xaml works fine. The UserControl is being displayed in a WPFElementHost if that might make a difference. The other thought I had was that I might need to specify the TabIndex for all the other controls, but I haven't read that anywhere and I'd prefer to not state that explicitly if possible. Does anyone have a guess as to what might be going wrong?
Focusable="False"
make any difference? – SeesawFocusable="False"
did not change the behavior. I can still tab to the button in question. Also, I tried it in combination with theIsTabStop="False"
attribute, as well as by itself. – PanthiaListBox
. While empty,.IsTabStop=false
is enough to exclude it from tab-sequence. Once its.ItemsSource
is assigned, it is included. Then data is reset, and it's not in sequence; then data is set again - and it's in. And again, and again.. Setting.Focusable=false
in addition has no effect. – TheodoretheodoricUserControl
that has itsItemsSource
assigned (and that probably resetsIsTabStop
). Pretty unnerving. – PlastUserControl
based onItemsControl
and kept settingIsTabStop
on the user control to no avail when in fact my items control inside it kept getting focus with tab circulation. SettingIsTabStop
on the items control solved the issue. – Plast