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]
# 1

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

PaulDomag at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 2
Ah hah. I did not set my Text to blank. I'll give that a try! Thanks.
JonM at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 3
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.
Dustin_H at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 4
You will also want to set the forms icon property = nothing
DMan1 at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 5

Hi,

I did it before showing the form. I mean setting the controlbox = false, text = "" and status to maximize. I think I even did the controlbox=false in design time...

cheers,

Paul June A. Domag

PaulDomag at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 6
For some reason I'm sitll getting an extra bar with a default icon on it! argh.


Dim b As New form1

b.Text = ""

b.ControlBox = False

b.WindowState = FormWindowState.Maximized

b.Icon = Nothing

b.MdiParent = Me.ParentForm

b.Show()


JonM at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 7

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

PaulDomag at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 8
Paul,

I'm also using VS2005 (beta2)! Please send me the sample project. webmaster@accs.net. Thanks again!

JonM at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...
# 9

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

PaulDomag at 2007-9-9 > top of Msdn Tech,Visual Basic,Visual Basic General...