hi,
in my tabcontrol i have four tabpages(a,b,c,d), iget request from customer he want to see a(tabpage),
my requirement is i dont want to navigate to another tabpages(b,c,d).
how to restrict navigation from one tabpage to another tabpage.... all tabpages are disable except selected tab...
plz any one help me....
Loading
Nilanka DharmadasaPosted Nov 17, 2009, 7:18 AM
It's easy.
Let's say your customer requests for 'TabPage1'. I hope you know how to set it as the current tab of the tabcontrol.
If you don't know you can do it by,
tabControl1.SelectedTab = tabPage1;
Then you want to restrict from moving to other tab pages.
Just use 'Selecting' event of Tabcontrol. In that event write following code.
private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
{
tabControl1.SelectedTab = tabPage1;
}
This will prevent from going to another tab.
If you have any problem, please ask.
If you find this answer useful, please mark this as accepted.