P
Peted
I have a simple c# app that opens a child form in a mdi parent.
I want the child form to open in the center of the mdi parent, so i
can open the child form ok, it all works fine, but setting
frmConfig = new ConfigForm(this);
frmConfig.MdiParent = this;
frmConfig.TopLevel = false;
frmConfig.StartPosition = FormStartPosition.CenterParent;
frmConfig.Show();
does not seem to work regardless if i set it runtime or in the windows
properties at design time.
The only way i can get CenterParent to work is to display the form
using Showdialog(), but then it has to be top level and the user can
drag it out the bounds of the MDI parent.
What i have found is if i use
frmConfig.StartPosition = FormStartPosition.CenterScreen;
this will display the childform in the center of the parent, seemingly
regardless of where the parent is located on screen.
All the internet examples ive found say to use
FormStartPosition.CenterParent;
Does anyone have any idea whats going on and how it should be done ?
Peted
I want the child form to open in the center of the mdi parent, so i
can open the child form ok, it all works fine, but setting
frmConfig = new ConfigForm(this);
frmConfig.MdiParent = this;
frmConfig.TopLevel = false;
frmConfig.StartPosition = FormStartPosition.CenterParent;
frmConfig.Show();
does not seem to work regardless if i set it runtime or in the windows
properties at design time.
The only way i can get CenterParent to work is to display the form
using Showdialog(), but then it has to be top level and the user can
drag it out the bounds of the MDI parent.
What i have found is if i use
frmConfig.StartPosition = FormStartPosition.CenterScreen;
this will display the childform in the center of the parent, seemingly
regardless of where the parent is located on screen.
All the internet examples ive found say to use
FormStartPosition.CenterParent;
Does anyone have any idea whats going on and how it should be done ?
Peted