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 doing in the form to display:
public DealsForm()
{
InitializeComponent();
this.StartPosition = FormStartPosition.CenterParent;
}
Here is what I am doing to display the form:
private void nvShowDeals_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
DealsForm frm = new DealsForm();
frm.DataSource = this.Deals;
frm.Show(this);
}
I have tried putting the following in each of the above methods, to no avail:
this.StartPosition = FormStartPosition.CenterParent;
If I set it via the Property Editor ... it works perfectly, but I would really like to do it via code.
Should be a no-brainer ... but for the life of me I can't seem to figure it out ... maybe I need more caffeine.