![]() ![]() | ||
Your application looks great—but it's not starting off right. The displayed windows are just not where you want them. How can you fix this? You can use a form's StartPosition property to specify its initial position on the screen. You assign this property values from the FormStartPosition enumeration. Here are the possible values:
CenterParent— The form is centered within the bounds of its parent form.
CenterScreen— The form is centered on the current display and has the dimensions specified in the form's size.
Manual— The Location and Size properties of the form will determine its starting position.
WindowsDefaultBounds— The form is positioned at the Windows default location and has the bounds determined by Windows default.
WindowsDefaultLocation— The form is positioned at the Windows default location and has the dimensions specified in the form's size.
Here's how you can set a form's StartPosition property from code:
Form1.StartPosition = FormStartPosition.CenterScreen
![]() ![]() | ||