TabControl.SelectionChanged Event

Silverlight

Occurs when the selected TabItem changes.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls (in System.Windows.Controls.dll)

public event SelectionChangedEventHandler SelectionChanged
<sdk:TabControl SelectionChanged="eventhandler"/>

The following event handler responds to a change in the selection of a TabControl by making the same change to the selection of another TabControl. This code is part of a larger example available in the TabControl class overview.


//This handler responds to the user changing the selected
//TabItem on tab2 by changing the selection on tab1 to
//match.
void tab2_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    //Set the selected TabItem of tab1 to match tab2.
    tab1.SelectedIndex = tab2.SelectedIndex;
    //You can also use SelectedItem to progamatically set the 
    //selected TabItem.
}


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: