Dialog Box when exiting the application?

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
memethemyn
Posts: 51
Joined: Fri Apr 27, 2012 12:33 pm

Dialog Box when exiting the application?

Post 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..

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Dialog Box when exiting the application?

Post 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();
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply