Setting tab order in WPF

Román picture Román · Dec 11, 2008 · Viewed 95.5k times · Source

How do I set tab ordering in WPF? I have an ItemsControl with some items expanded and some collapsed and would like to skip the collapsed ones when I'm tabbing.

Any ideas?

Answer

Drew Noakes picture Drew Noakes · Feb 26, 2009

If you want to explicitly set the tab ordering for elements in your form, the following attached property is supposed to help:

<Control KeyboardNavigation.TabIndex="0" ... />

I say "supposed to help" as I haven't found it very reliable though I probably need to read more about how it is intended to be used. I only post this half baked answer because no one else mentioned this property.


Note that in Win RT, the property is just TabIndex="0".