Keep initial builder window from starting off the screen

This commit is contained in:
Tim Young 2017-02-25 10:56:47 +03:00
parent abc42db1f8
commit 708ff2372f

View File

@ -1423,10 +1423,14 @@ namespace EduNetworkBuilder
if (x + this.Width > Screen.FromControl(this).WorkingArea.X) if (x + this.Width > Screen.FromControl(this).WorkingArea.X)
x = Screen.FromControl(this).WorkingArea.X - this.Width; x = Screen.FromControl(this).WorkingArea.X - this.Width;
if (x < 0) x = 0; if (x < 0) x = 0;
if (x - 30 > Screen.FromControl(this).WorkingArea.Width)
x = 100;
if (y + this.Height > Screen.FromControl(this).WorkingArea.Y) if (y + this.Height > Screen.FromControl(this).WorkingArea.Y)
y = Screen.FromControl(this).WorkingArea.Y - this.Height; y = Screen.FromControl(this).WorkingArea.Y - this.Height;
if (y < 0) y = 0; if (y < 0) y = 0;
if (y - 30 > Screen.FromControl(this).WorkingArea.Height)
y = 100;
this.DesktopLocation = new Point(x, y); this.DesktopLocation = new Point(x, y);
} }