Category / Section
How to set ActiveTabBackColor, InactiveTabBackColor and default TabBackColor in WinForms TabControlAdv?
1 min read
Active and inactive tab color settings
The Active and Inactive Tab fore color can be handled using the SelectedIndexChanged event. Using this event you can set the text color in TabControlAdv.
C#
this.tabControlAdv1.SelectedIndexChanged += new EventHandler(tabControlAdv1_SelectedIndexChanged); void tabControlAdv1_SelectedIndexChanged(object sender, EventArgs e) { foreach (TabPageAdv item in this.tabControlAdv1.TabPages) { if (this.tabControlAdv1.SelectedTab == item) { item.TabForeColor = Color.Black; } else { item.TabForeColor = Color.Green; } } }
VB
AddHandler tabControlAdv1.SelectedIndexChanged, AddressOf tabControlAdv1_SelectedIndexChanged Private Sub tabControlAdv1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) For Each item As TabPageAdv In Me.tabControlAdv1.TabPages If Me.tabControlAdv1.SelectedTab Is item Then item.TabForeColor = Color.Black Else item.TabForeColor = Color.Green End If Next item End Sub
Reference link:
1. https://help.syncfusion.com/windowsforms/tabcontrol/events#selectedindexchanged-event
2. https://help.syncfusion.com/windowsforms/tabcontrol/appearance-settings