Tell me more ×  I would like to have a button that switches a
tab control to a specific tab item and afterwards set a focus on
a textbox within that tab item.  For this I have an event
handler for the click event like this  private void
MyButton_Click(object sender, RoutedEventArgs e)
MyTabControl.SelectedIndex = 0;  This does not work, the tab
item is changed but the text box remains without focus. How to
do this?  share|improve this question add comment  1 Answer  up
vote 4 down vote accepted  Call UpdateLayout before focusing the
textbox:    MyTabControl.SelectedIndex = 0; share|improve this
answer Perfect. Thanks! :-) –  Michael Hilus Sep 24 '12 at 12:22
add comment  Your Answer