From
<http://msdn2.microsoft .com/en-us/library/system.windows. forms.tabpage.e nabled.aspx>:
".NET Framework Class Library
TabPage.Enabled Property
This property supports the .NET Framework infrastructure and is not
intended to be used directly from your code.
This member is not meaningful for this control."
So, the tabcontrol doesn't really support this. There's lots of code on
the web to show you how to override the drawing of your tabcontrol and
disable tabs. In a pinch, it may be enough to handle the "Selecting"
event of the tabcontrol like this:
private void tabControl1_Sel ecting(object sender,
TabControlCance lEventArgs e) {
try {
if ( ! tabShouldBeEnab led(e.TabPageIn dex) )
e.Cancel = true;
} catch (Exception ex) {
_bugSentry.Repo rt(ex);
}
}
Did you check the Enabled property on the TabPage class?