I doubt that this is an issue with the WinForms controls but I'll ask anyway in case anyone has experienced this problem (and I haven't found any solution searching the web). My project is MDI with seven child forms so far. After a few months of development I finally experienced a problem when I select several of my menu options (launch several child forms). It doesn't matter what the order I select the menu options; the third menu option, whichever option that happens to be, gets a System.NullReferenceException.
The code for each menu option is this pattern:
sender, EventArgs e)
objDULAudit.WindowState = FormWindowState.Maximized;
The error happens at objDULAudit.Show(); (in this code example).
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I stepped through every line of code (as the child form instantiates) trying to run into the problem but I have not been successful.