0

I'm trying to check if a specific tab page is active in my tab control, in order to change some of the colors in my form. I have checked this question! but the problem I'm facing now is that I'm using materialskin framework, and looks like the tab selectors of this framework have no SelectedTab property, so I couldn't use

if(materialTabSelector1.Controls[5] == materialTabSelector1.SelectedTab) MessageBox.Show("Tab 5 Is Selected");
or any other similar codes provided in the answers of that post. maybe I can handle the mouse left button click on each of the tabs, but the selector does not have a click event for each of it's pages.

any other suggestions for doing that?

Community
  • 1
  • 1
Ali HS
  • 99
  • 1
  • 11

2 Answers2

0

The TabSelector is just for Displaying the what Tab is Active, but it does not contain any Controls or logic behind it. But it has a BaseTabControl, which is pretty much a normal TabControl. In there you could apply your logic.

glm9637
  • 894
  • 9
  • 20
0

Came across this issue myself, for anybody else looking for the code:#

if (materialTabSelector1.BaseTabControl.SelectedTab == tabPage5)
                {
                  MessageBox.Show("Tab 5 Is Selected");
                }
H121M
  • 22
  • 4