Back button to close the form on a Windows Mobile / Standard smartphone

In Windows Mobile PocketPC / Pro, you can specify that the "Minimize" button is used to close the form (trigger the "Close" event, etc.) by setting MinimizeBox = "false". On a smartphone, the back button is used in the same way as the X in the corner of a PocketPC form, but I can't find an obvious (or less obvious) function that allows me to change its behavior to Close rather than Collapse.

Any hints on how to do this?

0


a source to share


1 answer


This article is about capturing the back button. There is also a sample in the SDK .



However, in my opinion, you shouldn't override its functionality. Another approach that you could follow is to start a timer in your form's OnDeactivate handler. Assuming your main form is not hidden by another form in your application, this will be called when your application is in the background. If you have multiple forms, more work is required to capture the event in the background. If the user doesn't bring your app to the front within a reasonable timeframe, close it.

+2


a source







All Articles