private void tabControl_Selecting(object sender, TabControlCancelEventArgs e) { e.Cancel = !e.TabPage.Enabled; }