Alex,
Usually the way I handle this type of situation is my application is
controled by a custom class vs a form or MDI form. For instance, I'll have a
class named AppManager and that is instantiated in the main method. All of
my forms accept an instance of the AppManager object so they have access to
the MDI or anything else you might want access to across the lifetime of the
application. Don't forget to go into the properties of the project and set
AppManager as your startup object. Also, you'll have to fully qualify the
class name with the full namespace in the "startup object" setting. There
may be a better way to do this, but this is how I've handled it.. I used a
class/form named FMDI for the example. Just change that to whatever the name
of your form is.
public class AppManager
{
protected FMDI _mdi = null;
public AppManager()
{
this._mdi = new FMDI(this);
Application.Run(this._mdi);
}
public FMDI MDI
{
get{return(this._mdi);}
set{this._mdi = value;}
}
[STAThread]
static void Main(string[] args)
{
AppManager appMgr = new AppManager();
}
}