private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
tabStack.RemoveAll(x => x == tabForms.SelectedTab);
try
{
TabPage tabMe = tabForms.SelectedTab;
Form frmMe = (tabForms.SelectedTab.Tag as Form);
frmMe.Close();
tabMe.Dispose();
}
catch (Exception)
{
}
if (tabStack.Count > 0)
{
tabStack.RemoveAt(tabStack.Count - 1);
try
{
tabForms.SelectedTab = tabStack.Last();
}
catch (Exception)
{
tabForms.SelectedTab = null;
}
}
tabForms.Invalidate();
}