L
Lee Crabtree
I remember when I was first getting into .NET Forms programming that
there was a rather emphatic rule about not constructing a form before
calling Application.Run with it. So this:
Application.Run(new Form1());
was okay, but this:
Form1 form = new Form1();
Application.Run(form);
Was a Bad Idea(TM). Indeed, even now, in VS2005, when a Forms app is
being generated, Studio creates the Main method in the first style.
The problem is that I need to make a couple of things in the form
visible to my global exception handler, so that I can quickly react to
an exception and put some hardware in a safe state. Is it still
dangerous to construct a form before calling Application.Run?
Lee Crabtree
there was a rather emphatic rule about not constructing a form before
calling Application.Run with it. So this:
Application.Run(new Form1());
was okay, but this:
Form1 form = new Form1();
Application.Run(form);
Was a Bad Idea(TM). Indeed, even now, in VS2005, when a Forms app is
being generated, Studio creates the Main method in the first style.
The problem is that I need to make a couple of things in the form
visible to my global exception handler, so that I can quickly react to
an exception and put some hardware in a safe state. Is it still
dangerous to construct a form before calling Application.Run?
Lee Crabtree