Page 1 of 1

Dialog Box when exiting the application?

Posted: Wed Jun 20, 2012 2:06 am
by memethemyn
Hi..

I write the following code into my project to ask operator when exit the program but I didnt find what i must write after if cause:(

Code: Select all

void Button2_Click(System.Object sender, System.EventArgs e)
		{
			DialogResult c;
			c = MessageBox.Show("Programdan çıkmak istediğinizden emin misiniz ?", "Sistem Çıkış İzni",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
			if (c==DialogResult.OK) 
			{
			
			}
I tried Application.Exit(); but didnt work..

Thanks Already..

Re: Dialog Box when exiting the application?

Posted: Wed Jun 20, 2012 7:06 am
by mark.monroe
This code will close the application on a PC. Put it in the "if" section of your example code. It should all be on the same line, but the forum system is wrapping it.

Code: Select all

Neo.ApplicationFramework.Common.Service.ServiceContainerCF.GetService<Neo.ApplicationFramework.Interfaces.IProjectService>().Close();