public void CloseMdiControlCommand(string tabName)
 {
     for (int index = 0; index < TabItemsList.Count; index++)
     {
         if (TabItemsList[index].Name == tabName)
         {
             if (index > 0)
             {
                 SelectMdiIndex = index - 1;
             }
             else if (index < TabItemsList.Count - 1)
             {
                 SelectMdiIndex = index + 1;
             }
             TabItemsList.RemoveAt(index);
             break;
         }
     }
 }
Example #2
0
 /// <summary>
 /// 构造方法
 /// </summary>
 public TabControl()
 {
     DefaultStyleKey = typeof(TabControl);
     Items           = new TabItemsList();
     _selector       = new SelectionChanger(this);
 }