Form Size and Location

During its lifetime, the form is likely to take up space at some location. The initial location for the form is governed by the StartPosition property, which can have one of several values from the FormStartPosition enumeration:

enum FormStartPosition {
  CenterParent,
  CenterScreen,
  Manual,
  WindowsDefaultBounds,
  WindowsDefaultLocation, //  default
}

These values have the following behavior:

  • WindowsDefaultLocation. The form's starting position will be determined by Windows, which will pick a location staggered from the upper-left corner of the screen toward the lower right in an attempt to make sure that new windows neither cover each other nor fall off the screen. The form will be shown with whatever the Size property was ...

Get Windows Forms Programming in C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.