diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 03d9e9fc..c17d77b9 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index ca3bf89d..c3c9a552 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll index e21a57b6..dca1ef2b 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/ref/SunnyUI.dll b/Bin/net5.0-windows/ref/SunnyUI.dll index 313b442f..f2e7cfb2 100644 Binary files a/Bin/net5.0-windows/ref/SunnyUI.dll and b/Bin/net5.0-windows/ref/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index 9a393f16..32f3fdc2 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI/Forms/UIFormHelper.cs b/SunnyUI/Forms/UIFormHelper.cs index 95015e7b..d31c0f05 100644 --- a/SunnyUI/Forms/UIFormHelper.cs +++ b/SunnyUI/Forms/UIFormHelper.cs @@ -20,6 +20,7 @@ * 2020-05-05: V2.2.5 增加下拉选择框,进度提升窗体 ******************************************************************************/ +using System; using System.Collections; using System.Drawing; using System.Windows.Forms; @@ -602,6 +603,14 @@ namespace Sunny.UI public interface IFrame { + UITabControl MainTabControl { get; } + + UIPage AddPage(UIPage page, int index); + + UIPage AddPage(UIPage page, Guid guid); + + UIPage AddPage(UIPage page); + void SelectPage(int pageIndex); } } \ No newline at end of file diff --git a/SunnyUI/Frames/UIMainFrame.cs b/SunnyUI/Frames/UIMainFrame.cs index 02d56a52..5db8f787 100644 --- a/SunnyUI/Frames/UIMainFrame.cs +++ b/SunnyUI/Frames/UIMainFrame.cs @@ -68,36 +68,6 @@ namespace Sunny.UI base.OnShown(e); } - public UIPage AddPage(UIPage page, int index) - { - page.Frame = this; - page.PageIndex = index; - MainContainer.AddPage(page); - return page; - } - - public UIPage AddPage(UIPage page, Guid guid) - { - page.Frame = this; - page.PageGuid = guid; - MainContainer.AddPage(page); - return page; - } - - public UIPage AddPage(UIPage page) - { - page.Frame = this; - MainContainer.AddPage(page); - return page; - } - - public virtual void SelectPage(int pageIndex) - { - MainContainer.SelectPage(pageIndex); - } - - protected UITabControl MainTabControl => MainContainer; - public bool TabVisible { get => MainContainer.TabVisible; @@ -129,5 +99,36 @@ namespace Sunny.UI [Description("页面选择事件"), Category("SunnyUI")] public event OnSelecting Selecting; + + #region IFrame实现 + + [Browsable(false)] + public UITabControl MainTabControl => MainContainer; + + public UIPage AddPage(UIPage page, int index) + { + page.PageIndex = index; + return AddPage(page); + } + + public UIPage AddPage(UIPage page, Guid guid) + { + page.PageGuid = guid; + return AddPage(page); ; + } + + public UIPage AddPage(UIPage page) + { + page.Frame = this; + MainTabControl.AddPage(page); + return page; + } + + public virtual void SelectPage(int pageIndex) + { + MainTabControl.SelectPage(pageIndex); + } + + #endregion IFrame实现 } } \ No newline at end of file