Form.CenterToScreen Method ()

 

This API supports the product infrastructure and is not intended to be used directly from your code.

Centers the form on the current screen.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

protected void CenterToScreen()

Do not call this directly from your code. Instead, set the StartPosition property to CenterScreen.

The CenterToScreen method uses the following priority list to determine the screen used to center the form:

  1. The Owner property of the form.

  2. The HWND owner of the form.

  3. The screen that currently has the mouse cursor.

.NET Framework
Available since 1.1
Return to top
Show: