E
ESmith
When a user starts up my application, I want to check for some prerequisite
conditions, and if not met, the exit the application.
Example:
public Form1()
{
InitializeComponent();
if ( MandatoryConditionsNotPresent() )
{
MessageBox.Show ("So Sorry! Unable to run.");
Close() <-- if I do this, I'll get an exception thrown in
Application.Run(new Form1());
}
...
}
What is the proper way to exit gracefully? (Or do I just wrap the
Application.Run in a Try/Catch block?)
TIA!
conditions, and if not met, the exit the application.
Example:
public Form1()
{
InitializeComponent();
if ( MandatoryConditionsNotPresent() )
{
MessageBox.Show ("So Sorry! Unable to run.");
Close() <-- if I do this, I'll get an exception thrown in
Application.Run(new Form1());
}
...
}
What is the proper way to exit gracefully? (Or do I just wrap the
Application.Run in a Try/Catch block?)
TIA!