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.

@No__t-0 方法使用下面的优先级列表来确定用于居中显示窗体的屏幕: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.

适用于

另请参阅