Back to Devexpress

DXTabControl.SelectionChanged Event

wpf-devexpress-dot-xpf-dot-core-dot-dxtabcontrol-543b42a9.md

latest5.2 KB
Original Source

DXTabControl.SelectionChanged Event

Occurs after a tab item has been selected.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public event TabControlSelectionChangedEventHandler SelectionChanged
vb
Public Event SelectionChanged As TabControlSelectionChangedEventHandler

Event Data

The SelectionChanged event's data class is TabControlSelectionChangedEventArgs. The following properties provide information specific to this event:

PropertyDescription
NewSelectedIndexGets the index of the currently selected tab item.
NewSelectedItemGets a data item that corresponds to the currently selected tab item.
OldSelectedIndexGets the index of the previously selected tab item.
OldSelectedItemGets a data item that corresponds to the previously selected tab item.

Remarks

The SelectionChanged event occurs after a tab item has been selected. The selected tab item is returned by the DXTabControl.SelectedItem property. The index of the previously selected item is returned by the event parameter’s TabControlSelectionChangedEventArgs.OldSelectedIndex property.

To prevent individual tab items from being selected, handle the DXTabControl.SelectionChanging event.

To learn more, see Header Menu.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectionChanged event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/MainWindow.xaml#L29

xml
<dx:DXTabControl x:Name="tabControl" Grid.Row="1" Grid.Column="0" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="CS" Width="250">

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/MainWindow.xaml#L29

xml
<dx:DXTabControl x:Name="tabControl" Grid.Row="1" Grid.Column="0" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="CS" Width="250">

wpf-richedit-document-api/CS/DXRichEditControlAPISample/MainWindow.xaml#L28

xml
<dx:DXTabControl x:Name="tabControl" Grid.Row="1" Grid.Column="0" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="CS" Width="250">

dxrichedit-for-wpf-how-to-implement-progress-indicator/CS/MainWindow.xaml#L17

xml
<Button Name="btnMailMerge" Content="Mail Merge" Width="200" HorizontalAlignment="Left" Margin="5" Click="btnMailMerge_Click" />
<dx:DXTabControl Name="tabControl" Grid.Row="1" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="Template">

wpf-richedit-use-docvariable-fields/CS/MainWindow.xaml#L21

xml
<dx:DXTabControl Name="tabControl" Grid.Row="1" SelectionChanged="tabControl_SelectionChanged">
    <dx:DXTabItem Header="Template">

See Also

SelectNext()

SelectPrev()

SelectionChanging

DXTabControl Class

DXTabControl Members

DevExpress.Xpf.Core Namespace