* UITabControl: 关闭TabPage并销毁TabPage

This commit is contained in:
Sunny 2021-08-14 13:43:25 +08:00
parent 8b8f1bc68d
commit da7b58168c
5 changed files with 2 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -589,8 +589,9 @@ namespace Sunny.UI
} }
} }
TabPages.Remove(TabPages[index]); TabPages.Remove(tabPage);
AfterRemoveTabPage?.Invoke(this, index); AfterRemoveTabPage?.Invoke(this, index);
tabPage.Dispose();
if (TabCount == 0) return; if (TabCount == 0) return;
if (index == 0) SelectedIndex = 0; if (index == 0) SelectedIndex = 0;