private void RestoreSizeAndPosition() { var name = Properties.Settings.Default.ScreenName; var screen = WFUtils.GetScreenByName(name); if (screen == null) { return; } this.Top = Properties.Settings.Default.Top; this.Left = Properties.Settings.Default.Left; this.Width = Properties.Settings.Default.Width; this.Height = Properties.Settings.Default.Height; this.WindowState = (WindowState)Properties.Settings.Default.WindowState; this.WindowStartupLocation = WindowStartupLocation.Manual; }