private void StoreSizeAndPosition() { Properties.Settings.Default.WindowState = (int)this.WindowState; if (this.WindowState != WindowState.Normal) { this.WindowState = WindowState.Normal; } var pt = new Point(this.Left, this.Top); var screen = WFUtils.GetScreenByPixel(ToPixel(pt)); Properties.Settings.Default.ScreenName = screen?.Name; Properties.Settings.Default.Top = this.Top; Properties.Settings.Default.Left = this.Left; Properties.Settings.Default.Width = this.Width; Properties.Settings.Default.Height = this.Height; Properties.Settings.Default.Save(); }