UIForm最大化支持多屏
This commit is contained in:
parent
3a765bcbdd
commit
f1b5d82bae
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.
@ -447,5 +447,11 @@ namespace Sunny.UI
|
||||
column.Width = width;
|
||||
return column;
|
||||
}
|
||||
|
||||
public static DataGridViewColumn SetSortMode(this DataGridViewColumn column, DataGridViewColumnSortMode sortMode = DataGridViewColumnSortMode.Automatic)
|
||||
{
|
||||
column.SortMode = sortMode;
|
||||
return column;
|
||||
}
|
||||
}
|
||||
}
|
@ -388,14 +388,25 @@ namespace Sunny.UI
|
||||
|
||||
private void ShowMaximize()
|
||||
{
|
||||
int screenIndex = 0;
|
||||
for (int i = 0; i < Screen.AllScreens.Length; i++)
|
||||
{
|
||||
if (MousePos.InRect(Screen.AllScreens[i].Bounds))
|
||||
{
|
||||
screenIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Screen screen = Screen.AllScreens[screenIndex];
|
||||
if (windowState == FormWindowState.Normal)
|
||||
{
|
||||
size = Size;
|
||||
|
||||
Width = ShowFullScreen ? Screen.PrimaryScreen.Bounds.Width : Screen.PrimaryScreen.WorkingArea.Width;
|
||||
Height = ShowFullScreen ? Screen.PrimaryScreen.Bounds.Height : Screen.PrimaryScreen.WorkingArea.Height;
|
||||
Left = 0;
|
||||
Top = 0;
|
||||
Width = ShowFullScreen ? screen.Bounds.Width : screen.WorkingArea.Width;
|
||||
Height = ShowFullScreen ? screen.Bounds.Height : screen.WorkingArea.Height;
|
||||
Left = screen.Bounds.Left;
|
||||
Top = screen.Bounds.Top;
|
||||
StartPosition = FormStartPosition.Manual;
|
||||
SetFormRoundRectRegion(this, 0);
|
||||
|
||||
@ -409,8 +420,8 @@ namespace Sunny.UI
|
||||
}
|
||||
|
||||
Size = size;
|
||||
Left = Screen.PrimaryScreen.WorkingArea.Width / 2 - Size.Width / 2;
|
||||
Top = Screen.PrimaryScreen.WorkingArea.Height / 2 - Size.Height / 2;
|
||||
Left = screen.Bounds.Left + screen.WorkingArea.Width / 2 - Size.Width / 2;
|
||||
Top = screen.Bounds.Top + screen.WorkingArea.Height / 2 - Size.Height / 2;
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
SetFormRoundRectRegion(this, ShowRadius ? 5 : 0);
|
||||
windowState = FormWindowState.Normal;
|
||||
@ -419,8 +430,12 @@ namespace Sunny.UI
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
private Point MousePos;
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
MousePos = PointToScreen(e.Location);
|
||||
|
||||
if (FormBorderStyle == FormBorderStyle.None)
|
||||
{
|
||||
bool inControlBox = e.Location.InRect(ControlBoxRect);
|
||||
|
@ -4,6 +4,7 @@
|
||||
* 更新UIListBox消息处理Bug
|
||||
* 更新页面框架Main命名,继承关系为Private。继承后编译时删除Design.cs里面Main部分
|
||||
+ UINavMenu增加字体图标显示
|
||||
* UIForm最大化支持多屏
|
||||
|
||||
2020.05.26
|
||||
* 更新页面框架Main叠放次序
|
||||
|
Loading…
x
Reference in New Issue
Block a user