* UIForm:增加WindowStateChange事件判断WindowState状态,调整ShowFullScreen全屏显示
This commit is contained in:
parent
604d8f3167
commit
3c40a20952
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
BIN
Bin/SunnyUI.pdb
BIN
Bin/SunnyUI.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
SunnyUI.Demo/FMain.Designer.cs
generated
2
SunnyUI.Demo/FMain.Designer.cs
generated
@ -78,6 +78,7 @@
|
||||
this.uiLogo1.MinimumSize = new System.Drawing.Size(300, 80);
|
||||
this.uiLogo1.Name = "uiLogo1";
|
||||
this.uiLogo1.Size = new System.Drawing.Size(300, 80);
|
||||
this.uiLogo1.Style = Sunny.UI.UIStyle.Custom;
|
||||
this.uiLogo1.TabIndex = 3;
|
||||
this.uiLogo1.Text = "uiLogo1";
|
||||
//
|
||||
@ -99,6 +100,7 @@
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "FMain";
|
||||
this.Text = "SunnyUI.Net";
|
||||
this.WindowStateChange += new Sunny.UI.UIForm.OnWindowStateChange(this.FMain_WindowStateChange);
|
||||
this.Header.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
|
@ -80,5 +80,10 @@ namespace Sunny.UI.Demo
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void FMain_WindowStateChange(object sender, FormWindowState state)
|
||||
{
|
||||
state.ConsoleWriteLine("WindowState");
|
||||
}
|
||||
}
|
||||
}
|
@ -37,6 +37,10 @@ namespace Sunny.UI
|
||||
|
||||
private UIStatusForm statusForm;
|
||||
|
||||
public delegate void OnWindowStateChange(object sender, FormWindowState state);
|
||||
|
||||
public event OnWindowStateChange WindowStateChange;
|
||||
|
||||
public UIForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -462,6 +466,7 @@ namespace Sunny.UI
|
||||
if (InMinBox)
|
||||
{
|
||||
base.WindowState = FormWindowState.Minimized;
|
||||
WindowStateChange?.Invoke(this,FormWindowState.Minimized);
|
||||
InMinBox = false;
|
||||
}
|
||||
|
||||
@ -495,10 +500,10 @@ namespace Sunny.UI
|
||||
Height = ShowFullScreen ? screen.Bounds.Height : screen.WorkingArea.Height;
|
||||
Left = screen.Bounds.Left;
|
||||
Top = screen.Bounds.Top;
|
||||
//StartPosition = FormStartPosition.Manual;
|
||||
SetFormRoundRectRegion(this, 0);
|
||||
|
||||
TopMost = ShowFullScreen;
|
||||
windowState = FormWindowState.Maximized;
|
||||
WindowStateChange?.Invoke(this, FormWindowState.Maximized);
|
||||
}
|
||||
else if (windowState == FormWindowState.Maximized)
|
||||
{
|
||||
@ -513,9 +518,9 @@ namespace Sunny.UI
|
||||
|
||||
if (location.X == 0 && location.Y == 0) location = center;
|
||||
Location = StartPosition == FormStartPosition.CenterScreen ? center : location;
|
||||
//StartPosition = FormStartPosition.CenterScreen;
|
||||
SetFormRoundRectRegion(this, ShowRadius ? 5 : 0);
|
||||
windowState = FormWindowState.Normal;
|
||||
WindowStateChange?.Invoke(this, FormWindowState.Normal);
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
@ -1110,11 +1115,6 @@ namespace Sunny.UI
|
||||
|
||||
public string CloseAskString { get; set; }
|
||||
|
||||
private void UIForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
//SetStyle(UIStyles.Style);
|
||||
}
|
||||
|
||||
private FormWindowState windowState = FormWindowState.Normal;
|
||||
|
||||
public new FormWindowState WindowState
|
||||
|
1
SunnyUI/Forms/UIForm.designer.cs
generated
1
SunnyUI/Forms/UIForm.designer.cs
generated
@ -39,7 +39,6 @@
|
||||
this.Name = "UIForm";
|
||||
this.Text = "UIForm";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UIForm_FormClosing);
|
||||
this.Shown += new System.EventHandler(this.UIForm_Shown);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,8 @@
|
||||
+ 增加; - 删除; * 修改
|
||||
|
||||
2020.06.22
|
||||
* UIForm:增加WindowStateChange事件判断WindowState状态,调整ShowFullScreen全屏显示
|
||||
|
||||
2020.06.21
|
||||
+ UIMessageTipHelper:增加MessageTip扩展方法
|
||||
+ UILoginForm:登录窗体增加两张图片
|
||||
|
Loading…
x
Reference in New Issue
Block a user