Hey team. I developed a small win forms that has a tab control for switching between tab pages.The form consists of two tab pages.
Thanks in advance for the help.
Criteria what i need:
1. tab pages should not get selected on mouse click
What I have tried:
Code for disabling the manual selection of tab.(NOT WORKING)
private void tabControl1_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedTab == tabPage2)
{
tabControl1.SelectedTab = tabPage1;
MessageBox.Show("You don’t have permission !!");
}
else if(tabControl1.SelectedTab == tabPage1)
{
tabControl1.SelectedTab = tabPage2;
MessageBox.Show("You don’t have permission !!");
}
}
Code for redirecting from tabpage1 to tabpage2(WORKING GOOD)
private void t1NextTabRedirectButton_Click(object sender, EventArgs e)
{
tabControl1.SelectedTab = tabPage2;
}