PredictFocus was supposed to get Tab support in .NET 4, but the current MSDN implies that it is not. However, this may be overseeing the documentation; I have not tried, but you could do it.
If this does not work, there is a private method on KeyboardNavigation that may be useful to you; you will have to use reflection to invoke it, and for this you will need the appropriate access rights to the code, but this may work .. The NET Reflector shows the signature as follows:
private DependencyObject GetNextTab(DependencyObject e, DependencyObject container, bool goDownOnly)
Where e is the element for which you want to get the next tab, and container is its parent container. I'm not 100% sure what goDownOnly does, but I think that means you don't want to leave the parent container. The method will return null if there is no next tab for this element.
Keep in mind that this is a private method; very susceptible to change, the next version will come.
Edit: You will need an instance of KeyboardNavigation ! I completely forgot about it. There is static in FrameworkElement.KeyboardNavigation , but it is also internal, so reflection needs to be obtained.
source share