bucherren
bucherren

Reputation: 299

Why I got extra close button on mdi child window?

I got a strange problem. My mdi child form has 2 close buttons and 2 maximized buttons.

A screenshot of the problem:

enter image description here

I create the mdi child like this:

 summaryForm.MdiParent = ContainerForm;  
 summaryForm.WindowState = FormWindowState.Maximized;  
 summaryForm.Show();

If I get rid of "summaryForm.WindowState = FormWindowState.Maximized;", the window style is correct. But I hope to make the mdi child form maximized when created.

Upvotes: 10

Views: 1082

Answers (2)

Shimmy Weitzhandler
Shimmy Weitzhandler

Reputation: 104781

It's a bug in Winforms. This will happen when the child is created by the parent's constructor. Move it to the Load event.

Upvotes: 6

gm139
gm139

Reputation: 1

try this:

childform.ControlBox = false;

Upvotes: 0

Related Questions