Is there a way to set the StartPosition of a Windows Forms form using code? It seems whatever I try results in the StartPostion being the default.
Here is what I am
You can do this by calling this.CenterToParent() in the Form_Load event (when the parent is actually known). Don't call this in the Constructor because the parent it set when Show(form) is called.
private void myForm_Load(object sender, EventArgs e)
{
CenterToParent();
}
I know this thread is old but it can be answered pretty easily so hopefully help others who come across it find the easy solution.