MDI help
Hey everyone,
I'm new to using mdi forms. Basically, the problem is that when I maximize my child form an extra line is added to the top of my main form with control box/max/min buttons for my child form. I don't want that line on there at all! I've tried everything, disabled everything. Any ideas on how to shut this off would be great!
Here is a screen shot of what I'm talking about.
http://www.accs.net/users/anonymous/mdihelp1.jpg
[584 byte] By [
JonM] at [2007-12-16]
Hi,
Just set the child form's ControlBox to false, Text to blank so that the header of the child form would be gone. Finally, when displaying the childform on the MDI, it should be maximized.
The only problem I see here is that there would be no way for the user to restore the child form...
cheers,
Paul June A. Domag
I tried your suggestion too, and it didn't seem to help. It takes away the control box before it's maximized. But when maximixed, the control box still re-appears in the mdi container window.
I also tried setting the MaxButton and MinButton to False, and tried setting the form with no border. All this doesn't work. Not that it was my question, but i'd also like to get this answer, because i tried solving this for about 1 hour before i gave up.
Dustin.
Hi,
This is my code (in C#, although I think theres no difference):
Form1 childForm = new Form1();
childForm.Text = "";
childForm.ControlBox = false;
childForm.WindowState = FormWindowState.Maximized;
childForm.MdiParent = this;
childForm.Show();
Hmmm, it works fine on me. I'm calling this routine in a toolstrip button. If you want I'll send you a copy of the project.
BTW, im using VS2005
cheers,
Paul June A. Domag
Hi,
I forgot to mention that I handled the SizeChanged event of my child form. Here's the code:
if (this.WindowState == FormWindowState.Maximized) {
this.FormBorderStyle = FormBorderStyle.None;
} else {
this.FormBorderStyle = FormBorderStyle.Sizable;
}
Check your mail. I already sent it...
cheers,
Paul June A. Domag