Is it possible to completely prevent MainForm from loading during application startup (donβt know how to call it, perhaps component initialization)?
I tried:
public MainForm()
{
if (true)
{
Application.Exit();
return;
}
InitializeComponent();
}
and
public MainForm()
{
if (true)
{
this.Close();
Application.Exit();
return;
}
InitializeComponent();
}
and without a "return"; also.
The first one does virtually nothing, while the second solution calls "Unable to access the remote object." error?
Is it possible to close the entire application before it is fully downloaded?
Just to make it clear, I want the application to not load in case of a failure in connecting to the database.
source
share