Do not call the Form.CenterToParent method directly from your code. Instead, set the Form.StartPosition property to FormStartPosition.CenterParent.
If the form or dialog is top-level, then Form.CenterToParent centers the form with respect to the screen or desktop.