We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to detect tab selection in TabBarSplitterControl?

Platform: WinForms |
Control: TabBarSplitterControl |
Published Date: January 22, 2016 |
Last Revised Date: June 20, 2021

In TabBarSplitterControl, the tab selection can be detected by handling events named “SelectedIndexChanging” and “SelectedIndexChanged”.

 

The following code example demonstrates the same.

C#

//The event will raised before the selected tab index changing
this.tabBarSplitterControl1.Bar.SelectedIndexChanging += new Syncfusion.Windows.Forms.SelectedIndexEventHandler(Bar_SelectedIndexChanging);
//The event will raised after the selected tab index changed
this.tabBarSplitterControl1.Bar.SelectedIndexChanged += new Syncfusion.Windows.Forms.SelectedIndexEventHandler(Bar_SelectedIndexChanged);
 
private void Bar_SelectedIndexChanging(object sender, Syncfusion.Windows.Forms.SelectedIndexEventArgs e)
{
 MessageBox.Show("SelectedIndexChanging is " + e.Tab.ToString());
}
 
private void Bar_SelectedIndexChanged(object sender, Syncfusion.Windows.Forms.SelectedIndexEventArgs e)
{
 MessageBox.Show("SelectedIndexChanged is " + e.Tab.ToString());
}

 

VB

'The event will raised before the selected tab index changing
AddHandler Me.tabBarSplitterControl1.Bar.SelectedIndexChanging, AddressOf Bar_SelectedIndexChanging
'The event will raised after the selected tab index changed
AddHandler Me.tabBarSplitterControl1.Bar.SelectedIndexChanged, AddressOf Bar_SelectedIndexChanged
 
Private Sub Bar_SelectedIndexChanging(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.SelectedIndexEventArgs)
 MessageBox.Show("SelectedIndexChanging is " & e.Tab.ToString())
End Sub
 
Private Sub Bar_SelectedIndexChanged(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.SelectedIndexEventArgs)
 MessageBox.Show("SelectedIndexChanged is " & e.Tab.ToString())
End Sub

 

SelectedIndexChanging event is fired on tab selection

Figure 1. SelectedIndexChanging event is fired on tab selection.

SelectedIndexChanged event is fired on tab selection

Figure 2. SelectedIndexChanged event is fired on tab selection.

Sample Links:

C#: TabBarSplitterControl_C#

VB: TabBarSplitterControl_VB

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile