Search code examples
c#winformsmdisdi

C# - WinForms - SDI or MDI Approach?


I am creating a Visual C# WinForms application that will contain 4 forms:

  1. A "control" form that will have anywhere between 2 buttons and potentially up to 10 or so. So the screen will need to accommodate enough space for the maximum amount of buttons.
  2. A "logging" form that will contain a large rich textbox control.
  3. A "config" form that will contain a tab control with various configuration settings that can be tweaked.
  4. A "order log" form that's very similar to #2.

It's likely that the user will want to reposition each of these forms in different ways. Yet, I would like these forms to be "managed" by a parent form so that when the application closes, all of the other forms close. Is there a way to keep the MDI approach, yet allow the child forms move outside of the parent form using C# WinForms? Thanks!


Solution

  • I have worked with MDI applications a bit and have tried something similar.

    There are a few things I have learned from experience that you should consider before you decide.

    One thing I have noticed with MDI's is that the forms and controls seem to paint a little slower than regular forms. So when you click a link/button and throw up a new child form, you can see it visually paint the new child form onto the screen, which makes your application seem sluggish. This has been tested on a huge host of hardware/OS combinations and with test applications that aren't doing anything but opening a form with some controls on it.

    Another thing about MDI is your child windows will be contained within the parent window, which works for some applications, but is annoying for others.

    Another quirk with MDI is that you cannot use window transparency, if you have such a need for that.