#639 – Default Tab Order Is Sensible

In WPF, you can use the Tab key to cycle through all of the focusable controls in a window, changing which control currently has focus.

You normally don’t need to worry about the tab order for controls in a window or page because WPF sets the tab order to match the logical tree.  If you start an application and press the Tab key, the first control in the logical tree will receive focus.

If you then continue to press Tab, each control in the logical tree that has its IsTabStop property set will receive focus.  The order will match the logical tree, starting at the top-level parent and working in a depth-first fashion through all child controls.

In the example below, we have several nested StackPanelin a window.  The numbers indicate the effective tab order.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #639 – Default Tab Order Is Sensible

  1. Pingback: Dew Drop – September 5, 2012 (#1,394) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: