By default, two TabItems are present. Change their "Header" properties to be something more descriptive. You can add a third TabItem by right-clicking and selecting "Add TabItem."
<Window x:Class=
"WpfApplication25.MainWindow"
xmlns=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x=
"http://schemas.microsoft.com/winfx/2006/xaml"
Title=
"MainWindow" Height=
"350" Width=
"525">
<Grid>
<TabControl HorizontalAlignment=
"Left"
Height=
"299"
Margin=
"10,10,0,0"
VerticalAlignment=
"Top"
Width=
"497"
SelectionChanged=
"TabControl_SelectionChanged">
<TabItem Header=
"Cat">
<Grid Background=
"#FFE5E5E5">
<TextBlock HorizontalAlignment=
"Left"
Margin=
"10"
TextWrapping=
"Wrap"
Text=
"Take pictures of me and put them on the Internet. Meow."
VerticalAlignment=
"Top"
Width=
"471"/>
</Grid>
</TabItem>
<TabItem Header=
"Mouse">
<Grid Background=
"#FFE5E5E5">
<TextBlock HorizontalAlignment=
"Left"
Margin=
"10"
TextWrapping=
"Wrap"
Text=
"I want some cheese."
VerticalAlignment=
"Top"
Width=
"471"/>
</Grid>
</TabItem>
</TabControl>
</Grid>
</Window>
using System.Windows;
using System.Windows.Controls;
namespace WpfApplication25
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// ... Get TabControl reference.
var item = sender as TabControl;
// ... Set Title to selected tab header.
var selected = item.SelectedItem as TabItem;
this.Title = selected.Header.ToString();
}
}
}