C#.codebox 3
WPF – How to set the tab order in XAML Designer in VS2008?
Unfortunately, currently there is no simple way to do this (like in Windows Forms, with View->Tab Order).
An easy way to do it, is to use the properties window search functionality to filter only the TabIndex property and then apply appropriate values for each control. However, when your window is loaded you have to press the TAB key at least once, to set the focus on the first control in the tab order.
To do this automatically though, and to select/set focus on a control at runtime, you can do something like:
1 2 3 4 5 | //Load private void Window_Loaded(object sender, RoutedEventArgs e) { TextBox1.Focus(); //set focus on a textbox } |
