1

I have a custom control in WPF that simply holds a combo box (however I have a few features of it, which is why its sitting inside this custom control.). When I tab through the items and reach it, I can no longer tab anymore. I tried tabbing back and fwd and nothing works. I have this same logic used for a textbox and it works just fine, just the combobox is causing a lockup.

Any ideas how to make it continue tabbing through my UI?

This is a semi dupe of WPF tab order with custom controls? however the answer there for C# does not work for me. It is throwing me the error: {"PropertyMetadata is already registered for type 'ctrlComboBox'."}

Community
  • 1
  • 1
Anthony Greco
  • 2,885
  • 4
  • 27
  • 39

1 Answers1

2

It sounds like the KeyboardNavigation.TabNavigation property is set to KeyboardNavigationMode.Contained when you possible want it to be KeyboardNavigationMode.Continue.

Have a read of the MSDN article on Focus, specifically the section on Keyboard Navigation. http://msdn.microsoft.com/en-us/library/aa969768.aspx

Dennis
  • 20,275
  • 4
  • 64
  • 80
  • That did not solve it, however that did help another issue with IsTabStop not working (used KeyboardNavigation.SetIsTabStop on an Overload of IsTabStop) – Anthony Greco Jul 07 '11 at 21:37
  • Interesting. It certainly sounded like the focus was getting trapped within the `Combobox`. I will mock up a test tomorrow morning and see if I can reproduce the issue. – Dennis Jul 07 '11 at 21:48
  • Well not exactly the solution I was looking for, i can detect tab on the combo box's keyup and detect for e.key = 3, then move to next based on coding at MSDN. Now I am just doing some conditions so it makes sure it has focus (else it detects the up on tab to it) and also reverse tabbing. Thanks =) – Anthony Greco Jul 07 '11 at 21:55
  • 1
    Goof luck. Focus is one of the most trickiest parts of interface development, especially in WPF. – Dennis Jul 07 '11 at 22:44