System.Windows.Forms.Form.CenterToParent Method

Centers the position of the form within the bounds of the parent form.

Syntax

protected void CenterToParent ()

Remarks

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.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0