0

In my WPF application, I want to move focus to the controls using up, down, left and right keys.

Any ideas?

Bill Tarbell
  • 4,933
  • 2
  • 32
  • 52
sony
  • 1,453
  • 3
  • 35
  • 79

1 Answers1

1

Are you referring to the tab ordering? This means the order in which the focus cycles through your controls when you press TAB or SHIFT-TAB.

The tab ordering in WPF doesn't run in a specific sequence of numbers. Rather, it just checks to see what hte next highest number is. Ie: you could set one control to 0 and one control to 45 and as long there aren't any controls between 0 and 45 then it will jump to 45. To set the order in xaml you add this attached property to your definitions:

<Control KeyboardNavigation.TabIndex="0" />

If you want to exclude controls from the tab order you can:

<control IsTabStop="false"/>

If you'd like to know more information or this doesn't apply to you then can you please supply more detail in your question?

Bill Tarbell
  • 4,933
  • 2
  • 32
  • 52