Why is it that when I call ShowDialog() on my form, it resizes the form and relocates it to a seemingly random size and location? I don't seem to have any control over it.
I can gain some control over the size of the form if I attempt to reset its location as follows:
DataSourceForm dataSourceForm = new DataSourceForm();
dataSourceForm.ShowDialog();
dataSourceForm.Location = new System.Drawing.Point(
this.Location.X + DataSourceForm.OFFSET_X, this.Location.Y + DataSourceForm.OFFSET_Y);
where "this" refers to a parent dialog box (so I'm positioning my form relative to the parent).
But this, ironically, restores the size of my form as seen in the Visual Studios designer but does not set its location. It would be nice if ShowDialog didn't take control of the size or the location so that I can set both in either the designer or in the constructor without worry that they will change later on.
I can gain some control over the size of the form if I attempt to reset its location as follows:
DataSourceForm dataSourceForm = new DataSourceForm();
dataSourceForm.ShowDialog();
dataSourceForm.Location = new System.Drawing.Point(
this.Location.X + DataSourceForm.OFFSET_X, this.Location.Y + DataSourceForm.OFFSET_Y);
where "this" refers to a parent dialog box (so I'm positioning my form relative to the parent).
But this, ironically, restores the size of my form as seen in the Visual Studios designer but does not set its location. It would be nice if ShowDialog didn't take control of the size or the location so that I can set both in either the designer or in the constructor without worry that they will change later on.