protected override void RemovedControl(Control control)
{
var controlTabPanel = control as TabPanel;
if(control != null && controlTabPanel.Active && ActiveTabIndex < Tabs.Count)
EnsureActiveTab();
controlTabPanel.SetOwner(null);
base.RemovedControl(control);
}