-3

Is there any way to make "StartPosition" Starts to "Bottom"

enter image description here

enter image description here

AgentRed
  • 62
  • 5
  • 36

1 Answers1

4

Use location property.

this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2,
                          (Screen.PrimaryScreen.WorkingArea.Height - this.Height));

public Form1()
{
    InitializeComponent();
    this.StartPosition = FormStartPosition.Manual;
    this.Location = ...;
}
cdev
  • 5,043
  • 2
  • 33
  • 32
  • where should i put this? – AgentRed Feb 22 '19 at 07:44
  • below the initializecomponent(); ? – AgentRed Feb 22 '19 at 07:44
  • 1
    As a note, you *should* have something like: `Screen screen = Screen.FromHandle(this.Handle); this.Location = new Point((screen.WorkingArea.Width ...);` in `Form.Load()` or `OnHandleCreated()`. You're supposing that the application main Window is opened in the Primary screen, which may not be the case. – Jimi Feb 22 '19 at 14:15