使用Screen.FromPosition方法修复GetMouseInScreen方法的不足
This commit is contained in:
parent
b4aed739ca
commit
e9c84298c8
@ -479,8 +479,8 @@ namespace Sunny.UI
|
||||
|
||||
private void ShowMaximize(bool IsOnMoving = false)
|
||||
{
|
||||
int screenIndex = GetMouseInScreen(MousePosition);
|
||||
Screen screen = Screen.AllScreens[screenIndex];
|
||||
//int screenIndex = GetMouseInScreen(MousePosition);
|
||||
Screen screen = Screen.FromPoint(MousePosition);
|
||||
if (windowState == FormWindowState.Normal)
|
||||
{
|
||||
size = Size;
|
||||
@ -585,8 +585,8 @@ namespace Sunny.UI
|
||||
|
||||
if (!IsDisposed && FormMoveMouseDown)
|
||||
{
|
||||
int screenIndex = GetMouseInScreen(PointToScreen(e.Location));
|
||||
Screen screen = Screen.AllScreens[screenIndex];
|
||||
//int screenIndex = GetMouseInScreen(PointToScreen(e.Location));
|
||||
Screen screen = Screen.FromPoint(MousePosition);
|
||||
if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox)
|
||||
{
|
||||
ShowMaximize(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user