Form.CenterToScreen Form.CenterToScreen Form.CenterToScreen Form.CenterToScreen Method

定义

使窗体在当前屏幕上居中。Centers the form on the current screen.

protected:
 void CenterToScreen();
protected void CenterToScreen ();
member this.CenterToScreen : unit -> unit
Protected Sub CenterToScreen ()

注解

请勿在代码中直接调用此。Do not call this directly from your code. 与此相反,设置StartPosition属性设置为CenterScreenInstead, set the StartPosition property to CenterScreen.

CenterToScreen方法使用以下优先级列表以确定用于 center 窗体的屏幕:The CenterToScreen method uses the following priority list to determine the screen used to center the form:

  1. Owner窗体的属性。The Owner property of the form.

  2. HWND 窗体的所有者。The HWND owner of the form.

  3. 在屏幕当前具有鼠标光标。The screen that currently has the mouse cursor.

适用于

另请参阅