I have an MDI base form. On that form, I've placed the Sandbar menu control (www.divil.co.uk, really good control, and free).
Then, I have a form (frmInherit) with some components on it. I will not load it. Another form (frmOptions) derives from it.
in frmInherit, I've got a local function, LoadDatabase. This function reads from the app.config file. When I run this code, nothing's wrong, and all works fine. The problem is in my designer, that's yelling every time: "An error occurred while loading the document. Fix the error and then try to load the document again. The error message says: Object reference not set to an instance of object"
I've added the code in a Winzip file. Is there someone who would take a look at it, to show me what I'm doing wrong?
You should take the following steps in the added code to reproduce behavior:
-Create new form, frmOptions, that inherits from frmInherit.
-Open designer window for frmOptions. Everything works fine.
-Now, run the project. Immediately close the application.
-Open designer window from frmOptions. Everything works fine.
-Now, in the code from frmInherit, decomment the lines in LoadDatabase and WriteDatabase (first method is important).
-Run application again, open via File --> Options the options form.
-Close the form and the application.
-Now try to open designer window for frmOptions. Then an error message appears.