* UIPage:放在 [窗体Load、重载OnLoad、重载Init] 的内容每次页面切换都会执行。
This commit is contained in:
parent
f762c913da
commit
bd1ce6d1b4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21
SunnyUI.Demo/Controls/FButton.Designer.cs
generated
21
SunnyUI.Demo/Controls/FButton.Designer.cs
generated
@ -787,7 +787,7 @@
|
||||
this.uiSymbolButton13.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton13.Name = "uiSymbolButton13";
|
||||
this.uiSymbolButton13.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton13.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton13.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton13.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton13.Symbol = 61518;
|
||||
@ -801,7 +801,7 @@
|
||||
this.uiSymbolButton14.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton14.Name = "uiSymbolButton14";
|
||||
this.uiSymbolButton14.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton14.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton14.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton14.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton14.Symbol = 61514;
|
||||
@ -815,7 +815,7 @@
|
||||
this.uiSymbolButton15.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton15.Name = "uiSymbolButton15";
|
||||
this.uiSymbolButton15.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton15.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton15.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton15.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton15.Symbol = 61513;
|
||||
@ -829,7 +829,7 @@
|
||||
this.uiSymbolButton16.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton16.Name = "uiSymbolButton16";
|
||||
this.uiSymbolButton16.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton16.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton16.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton16.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton16.Symbol = 61517;
|
||||
@ -843,7 +843,7 @@
|
||||
this.uiSymbolButton17.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton17.Name = "uiSymbolButton17";
|
||||
this.uiSymbolButton17.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton17.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton17.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton17.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton17.Symbol = 61516;
|
||||
@ -881,7 +881,7 @@
|
||||
this.uiSymbolButton20.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton20.Name = "uiSymbolButton20";
|
||||
this.uiSymbolButton20.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.RightTop | Sunny.UI.UICornerRadiusSides.RightBottom)));
|
||||
this.uiSymbolButton20.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton20.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton20.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton20.Symbol = 61522;
|
||||
@ -895,7 +895,7 @@
|
||||
this.uiSymbolButton21.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton21.Name = "uiSymbolButton21";
|
||||
this.uiSymbolButton21.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton21.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton21.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton21.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton21.Symbol = 61520;
|
||||
@ -909,7 +909,7 @@
|
||||
this.uiSymbolButton22.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton22.Name = "uiSymbolButton22";
|
||||
this.uiSymbolButton22.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton22.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton22.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton22.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton22.Symbol = 61508;
|
||||
@ -923,7 +923,7 @@
|
||||
this.uiSymbolButton23.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton23.Name = "uiSymbolButton23";
|
||||
this.uiSymbolButton23.RadiusSides = Sunny.UI.UICornerRadiusSides.None;
|
||||
this.uiSymbolButton23.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton23.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton23.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton23.Symbol = 61544;
|
||||
@ -937,7 +937,7 @@
|
||||
this.uiSymbolButton24.MinimumSize = new System.Drawing.Size(1, 1);
|
||||
this.uiSymbolButton24.Name = "uiSymbolButton24";
|
||||
this.uiSymbolButton24.RadiusSides = ((Sunny.UI.UICornerRadiusSides)((Sunny.UI.UICornerRadiusSides.RightTop | Sunny.UI.UICornerRadiusSides.RightBottom)));
|
||||
this.uiSymbolButton24.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
this.uiSymbolButton24.RectSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)(((System.Windows.Forms.ToolStripStatusLabelBorderSides.Top | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
|
||||
| System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
|
||||
this.uiSymbolButton24.Size = new System.Drawing.Size(46, 35);
|
||||
this.uiSymbolButton24.Symbol = 61473;
|
||||
@ -1170,6 +1170,7 @@
|
||||
this.Name = "FButton";
|
||||
this.Symbol = 61640;
|
||||
this.Text = "Button";
|
||||
this.Load += new System.EventHandler(this.FButton_Load);
|
||||
this.PagePanel.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.uiImageButton4)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.uiImageButton3)).EndInit();
|
||||
|
@ -13,15 +13,27 @@ namespace Sunny.UI.Demo
|
||||
uiSymbolButton2.Symbol, 32, UIColor.Red);
|
||||
}
|
||||
|
||||
//放在OnLoad事件的每次页面切换都会执行
|
||||
protected override void OnLoad(EventArgs e)
|
||||
/// <summary>
|
||||
/// 放在 [窗体Load、重载OnLoad、重载Init] 的内容每次页面切换都会执行。
|
||||
/// 这三个选一个用就行了。
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void FButton_Load(object sender, EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
uiSwitch1.Active = uiSwitch4.Active = true;
|
||||
uiSwitch2.Active = uiSwitch3.Active = false;
|
||||
}
|
||||
|
||||
//放在Init事件的每次页面切换都会执行,和OnLoad保留一个就行了
|
||||
//放在 [窗体Load、重载OnLoad、重载Init] 的内容每次页面切换都会执行。
|
||||
//protected override void OnLoad(EventArgs e)
|
||||
//{
|
||||
// base.OnLoad(e);
|
||||
// uiSwitch1.Active = uiSwitch4.Active = true;
|
||||
// uiSwitch2.Active = uiSwitch3.Active = false;
|
||||
//}
|
||||
|
||||
//放在 [窗体Load、重载OnLoad、重载Init] 的内容每次页面切换都会执行。
|
||||
//public override void Init()
|
||||
//{
|
||||
// base.Init();
|
||||
|
1
SunnyUI/Pages/UIPage.Designer.cs
generated
1
SunnyUI/Pages/UIPage.Designer.cs
generated
@ -45,7 +45,6 @@
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
|
||||
this.Text = "UIPage";
|
||||
this.Load += new System.EventHandler(this.UIPage_Load);
|
||||
this.Shown += new System.EventHandler(this.UIPage_Shown);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
@ -25,6 +25,7 @@ using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Design;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Sunny.UI
|
||||
@ -229,6 +230,22 @@ namespace Sunny.UI
|
||||
public void ReLoad()
|
||||
{
|
||||
OnLoad(EventArgs.Empty);
|
||||
//EventLoad();
|
||||
}
|
||||
|
||||
private void EventLoad()
|
||||
{
|
||||
Type type = this.GetType().BaseType;
|
||||
while (type.Name != "Form")
|
||||
{
|
||||
type = type.BaseType;
|
||||
}
|
||||
|
||||
FieldInfo targetMethod = type.GetField("EVENT_LOAD", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);
|
||||
object obj = (object)targetMethod.GetValue(this);
|
||||
|
||||
EventHandler handler = (EventHandler)this.Events[obj];
|
||||
handler?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public virtual void Final()
|
||||
@ -579,10 +596,5 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void UIPage_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user