Form.CenterToScreen Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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)

member CenterToScreen : unit -> unit

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: