Revert "将GetMouseInScreen方法替换为Screen.FromControl,原因是在自动最大化过程中,由于窗体是向上停靠的,窗体的大部分区域都在要放大的屏幕上。若使用鼠标位置判断窗体所处屏幕,双屏且副显示器在下时,在副显示器中向顶部停靠,由于AllScreens的第一个是主屏幕,得到的需放大屏幕是错误的。"
This reverts commit 706573fcda16e6af9079853559ec24fb403f19e3.
This commit is contained in:
parent
706573fcda
commit
b4aed739ca
@ -479,8 +479,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
private void ShowMaximize(bool IsOnMoving = false)
|
private void ShowMaximize(bool IsOnMoving = false)
|
||||||
{
|
{
|
||||||
//int screenIndex = GetMouseInScreen(MousePosition);
|
int screenIndex = GetMouseInScreen(MousePosition);
|
||||||
Screen screen = Screen.FromControl(this);
|
Screen screen = Screen.AllScreens[screenIndex];
|
||||||
if (windowState == FormWindowState.Normal)
|
if (windowState == FormWindowState.Normal)
|
||||||
{
|
{
|
||||||
size = Size;
|
size = Size;
|
||||||
@ -585,8 +585,8 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
if (!IsDisposed && FormMoveMouseDown)
|
if (!IsDisposed && FormMoveMouseDown)
|
||||||
{
|
{
|
||||||
//int screenIndex = GetMouseInScreen(PointToScreen(e.Location));
|
int screenIndex = GetMouseInScreen(PointToScreen(e.Location));
|
||||||
Screen screen = Screen.FromControl(this);
|
Screen screen = Screen.AllScreens[screenIndex];
|
||||||
if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox)
|
if (MousePosition.Y == screen.WorkingArea.Top && MaximizeBox)
|
||||||
{
|
{
|
||||||
ShowMaximize(true);
|
ShowMaximize(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user