private void UpdateFromSettings(bool updateWindowState) { if (updateWindowState) { if (!Settings.Default.Size.IsEmpty) { this.Size = Settings.Default.Size; this.CenterToScreen(); } if (!_createdAtPoint.IsEmpty) { this.StartPosition = FormStartPosition.Manual; Rectangle formBounds = this.Bounds; Rectangle tabBounds = ProcessTabs.RectangleToScreen(ProcessTabs.GetTabRect(0)); int tabX = tabBounds.Left - formBounds.Left; int tabY = tabBounds.Top - formBounds.Top; int x = _createdAtPoint.X - tabX - tabBounds.Width / 2; int y = _createdAtPoint.Y - tabY - tabBounds.Height / 2; this.Location = new Point(x, y); } if (Settings.Default.Maximized) { this.WindowState = FormWindowState.Maximized; } } }