Pocket PC: How to stop a form from closing

85 pts.
Tags:
C#
Pocket PC
WinForms
Using C#, on a WinForm, to stop a form from closing, I simply have to put this line in the public Form1(): this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing); and add this bit: public void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (MessageBox.Show("Are you sure you want to exit?", "Confirm exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No) { e.Cancel = true; } However, on a Smart Device (I am using WM5) it doesn't run. Any ideas?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TJay
    I figured it out.. The problem is that the X button on a WM form acts as a "Smart Minimize" and does not actually close. Setting the MinimizeBox = False fixes it...
    85 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: