When I try to do a check to see that the active form is an MDIContainer, I keep getting an null reference error. Object reference not set to an instance of an object.
This is what I try:
Also some times a child form will open outside of the MDI container even though I set the MdiParent of that child form to the MDIcontainer.
Is MDIContainer good to use even or is there something better I should be looking at?
Any help would be greatly appreciated
Look at the form properties and find all of them containing sub-string "MDI", it will explain how to use MDI. —SA
MDIContainer is something you need to define.
I have a better advice:
But do yourself a favor, listen to my good friendly advice: don't do MDI!
There are not so many UI designs that are so inconvenient and cumbersome! Everyone I know (and I know very many computer people, not just developers) hate such user experience and well agree with me. You cannot find any serious company or UI developer using such design.
Instead, use tabbed UI, or dockable (or combined), or controlled by tree/list view TOC-page style, or folding panels or something like that.
When you run in debug mode and the exception occurs, hover your mouse pointer over each word in your statement.
The tooltip you should see will tell you which is
null. My guess would be
ActiveForm but only you can determine this for certain.
Once you have discovered the culprit you will need to think about the reason(s) that might be.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)