Timo Korinth

2 Meter, 2 Mark

Focus on TabItems


To pragmatically set the focus on TabItems in WPF or Silverlight it’s not enough to set “IsSelected” to true and call “Focus()” on the specific TabItem. In order to get to the desired result, you have to do the following steps:

  1. Set “tabControl.SelectedItem = tabItem” on the TabControl.
  2. Call “UpdateLayout()” on the TabControl.

If and only if you do this on the TabControl, the TabItem (and therefor the content) will get the focus.

Leave a Reply