views:

133

answers:

2

On PocketPC, when you tap the (X) to "close" the application, it stays open in the background. The only way to close it (without third-party programs) is to go to the settings->memory and close the program. Or you can run other programs so when the PPC gets to no memory it will close the earlier programs.

I am developing an application for PPC and I was wondering if there is an elegant way to actually CLOSE the application when user taps the (X) button in the top-right corner. Is there an event raised for this?

(Using .NET CF 3.5)

A: 

This will be an ugly hack, pocket pc applications are notorious for not actually exiting when you click on 'X' as done on the desktop Windows pc, in Pocket PC land, it sends it to the background as you have discovered...this can be done either upon receiving a 'Form_Close' event or an 'Application_Exit' event handler...

System.Diagnostics.Process.GetCurrentProcess().Kill();
tommieb75
+2  A: 

On a PocketPC Form, the X is a minimize button. The close button, on the other hand is an 'OK' button. To get the OK button to display, you can set the MinimizeBox property to 'False'.

Mike Clark