Remarks. This property enables you to set the starting position of the form when it is displayed at run time. The form's position can be specified manually by setting the Location property or use the default location specified by Windows.
Remarks. This enumeration is used by the StartPosition property of the Form class. It represents the different start positions of the form. The default start position is WindowsDefaultLocation .
In Visual Studio, drag the control to the appropriate location with the mouse. Select the control and move it with the ARROW keys to position it more precisely.
You need to set StartPosition
to manual to make the form set start position to the value in Location
Property.
public Form1()
{
InitializeComponent();
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(0, 0);
}
Intelisense Summary for FormStartPosition.Manual
FormStartPosition FormStartPosition.Manual
The position of the form is determined by the System.Windows.Forms.Control.Location property.
By default the start position is set to be WindowsDefaultLocation which will cause the form to ignore the location you are setting. To easily have the set location enforced, change the StartPosition to Manual.
Try:
this.Location = new Point(Screen.PrimaryScreen.Bounds.X, //should be (0,0)
Screen.PrimaryScreen.Bounds.Y);
this.TopMost = true;
this.StartPosition = FormStartPosition.Manual;
Setting the Location at 0,0 has no effect if you forget to set StartPosition to FormStartPosition.Manual
This property enables you to set the starting position of the form when it is displayed at run time. The form’s position can be specified manually by setting the Location property or use the default location specified by Windows. You can also position the form to display in the center of the screen or in the center of its parent form for forms such as multiple-document interface (MDI) child forms.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With