How do I terminate Application immediatly

  • Thread starter Thread starter msnews.microsoft.com
  • Start date Start date
M

msnews.microsoft.com

Hi there,
I wan't to run my application with argument that causes the application to
do something without showing up gui.
It works but in the end shows blank form and does not terminate (see code
snippet).

How can I terminate my application immediatly?

--------------------
public Fyrirtaekjavaki(bool keyra)
{
if (keyra)
{
LesaInnRSGGogn(true);
MessageBox.Show("Here");
Application.Exit();
}
else
InitializeComponent();
}
-------------------------
 
msnews.microsoft.com said:
I wan't to run my application with argument that causes the application to
do something without showing up gui.
It works but in the end shows blank form and does not terminate (see code
snippet).

How can I terminate my application immediatly?

--------------------
public Fyrirtaekjavaki(bool keyra)
{
if (keyra)
{
LesaInnRSGGogn(true);
MessageBox.Show("Here");
Application.Exit();
}
else
InitializeComponent();
}
-------------------------

Initialize only of the condition is true:

\\\
public static void Main()
{
if (...)
Application.Run(new MainForm());
}
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top