Application.Exit();

  • Thread starter Thread starter Yasin cepeci
  • Start date Start date
Y

Yasin cepeci

I want to close my application when the user submit cancal button on a
messagebox and go on if user submit ok button on a messagebox?
I couldnt find where is the triggers of messagebox?:(
 
Yasin cepeci said:
I want to close my application when the user submit cancal button on a
messagebox and go on if user submit ok button on a messagebox?
I couldnt find where is the triggers of messagebox?:(

You invoke the MessageBox and then check the result:

DialogResult result = MessageBox.Show(....);
if (result==DialogResult.Cancel)
{
Application.Exit();
}
else
{
....
}
 
It works thanks
haber said:
You invoke the MessageBox and then check the result:

DialogResult result = MessageBox.Show(....);
if (result==DialogResult.Cancel)
{
Application.Exit();
}
else
{
....
}
 
Back
Top