Form position setting (StartPosition property)

The StartPosition attribute has the following options, which have the following meanings:

The CenterParent form is centered in its parent form.    
The CenterScreen form is centered in the current display window, and its size is specified in the form size.    
The location of the Manual form is determined by the    Location    property.    
WindowsDefaultBounds The window is positioned in the   default position of   Windows   , and its boundary is also determined by    Windows    default.    
WindowsDefaultLocation The window is positioned at the  default position in    Windows   , and its size is specified in the window size.     
    
CenterScreen does not mean that the screen is centered (it is relative), it is centered in the "current display window".

When using the Show() method, you should select CenterScreen,

When using the ShowDialog() method, you should select CenterParent, so that the window to be displayed can be centered.

Guess you like

Origin blog.csdn.net/w492901074/article/details/53339523