yusuf

yusuf

  • NA
  • 57
  • 0

about Application.Exit();

Jan 17 2008 6:50 AM

Hi.

My problem has not been solved 100%... In Form_Closing event i typed Application.Exit(); because i have 2 forms.

 in Form_Closing event also i am asking 'Are you sure to exit the program'. When i click 'Yes' button, it doesn't repeat the question. But i click 'No', it is asking the question twice. Here are the codes.

Application.Exit();

if (kisiler != null)

{

if (MessageBox.Show("Programi kapatmak istiyor musunuz ?",

"YSM Üye Takip Programi", MessageBoxButtons.YesNo,

MessageBoxIcon.Question) == DialogResult.Yes)

{

if (MessageBox.Show("Bilgilerinizi kaydetmek istiyor musunuz ?",

"YSM Üye Takip Programi", MessageBoxButtons.YesNo,

MessageBoxIcon.Question) == DialogResult.Yes)

{

Helper.SaveList("kisiler.dat", kisiler);

}

}

else

{

e.Cancel = true;

}

}

Thanks..


Answers (3)