From 708ff2372ffbf349791957eddcbede485d631241 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Sat, 25 Feb 2017 10:56:47 +0300 Subject: [PATCH] Keep initial builder window from starting off the screen --- EduNetworkBuilder/NetworkBuilder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index 800a5c3..3b62bcf 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -1423,10 +1423,14 @@ namespace EduNetworkBuilder if (x + this.Width > Screen.FromControl(this).WorkingArea.X) x = Screen.FromControl(this).WorkingArea.X - this.Width; if (x < 0) x = 0; + if (x - 30 > Screen.FromControl(this).WorkingArea.Width) + x = 100; if (y + this.Height > Screen.FromControl(this).WorkingArea.Y) y = Screen.FromControl(this).WorkingArea.Y - this.Height; if (y < 0) y = 0; + if (y - 30 > Screen.FromControl(this).WorkingArea.Height) + y = 100; this.DesktopLocation = new Point(x, y); }