* UIForm: 多页面框架增加程序关闭时调用UIPage的Final和FormClosed事件

This commit is contained in:
Sunny 2022-07-25 16:53:27 +08:00
parent d04c025d75
commit 88d551b5e3
2 changed files with 19 additions and 0 deletions

View File

@ -20,6 +20,7 @@
******************************************************************************/
using System;
using System.Collections.Concurrent;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
@ -131,6 +132,8 @@ namespace Sunny.UI
}
}
private ConcurrentDictionary<int, Image> Images = new ConcurrentDictionary<int, Image>();
private int avatarSize = 120;
[DefaultValue(120), Description("头像大小"), Category("SunnyUI")]

View File

@ -37,6 +37,7 @@
* 2022-06-11: V3.1.9
* 2022-07-05: V3.2.1 PageAddedPageSelectedPageRemoved事件
* 2022-07-14: V3.2.1 UnRegisterHotKey
* 2022-07-25: V3.2.2 UIPage的Final和FormClosed事件
******************************************************************************/
using System;
@ -1625,6 +1626,21 @@ namespace Sunny.UI
}
}
protected override void OnFormClosed(FormClosedEventArgs e)
{
base.OnFormClosed(e);
if (MainTabControl != null)
{
foreach (var item in MainTabControl.GetControls<UIPage>(true))
{
item.Final();
item.Close();
item.Dispose();
}
}
}
[Description("文字对齐方式"), Category("SunnyUI")]
public StringAlignment TextAlignment
{