Question

I have inherited an application that was started as an MDI program, but the necessary background work was never put in place to fully support MDI. I'm trying to build in just enough MDI support to make the application look good and work properly as an SDI application.

Here's what I am observing, and I don't know how this is happening or how to fix it.

  1. The MDIchild form's border is shown above the MDIparent form's menu strip.
  2. The MDIchild form has two icons in the upper left.
  3. The MDIchild form has two ControlBoxes in the upper right.

alt text

Any ideas why this would be?

I'd be really happy if the MDIChild window border (including the icons and control boxes) was removed entirely.

Thanks, SH

Was it helpful?

Solution

I created the child form but showed it in normal state instead of maximized. It's as if showing the parent form in the same process as the maximized child form caused the form to be constructed out of order. My code looked something like this...

frmChild.WindowState = FormWindowState.Normal
frmParent.Show()  'frmChild.Show called within form_load of parent
frmChild.WindowState = FormWindowState.Maximized

And yes, I set the Child window's FormBorderStyle to None, but like I said, I didn't want an MDI application.

I think this must be a bug in Visual Studio. For so many people to have difficulty with it, it can't be right.

OTHER TIPS

I found:

Call Show() on your MDI form before setting the WindowState property on your child form to get rid of the multiple control boxes.

Do not set the WindowState to Maximized in the designer -- do it in code after you've shown the parent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top