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?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!