I am trying to write a simple CE program in C#, using the .Net Compact Framework. The first thing this app does is open a login dialog box. This dialog box also has an "Exit" button on it. If the user hits the exit button, I simply want to exit. I wrote the code this way:
LogonDialog ld = new LogonDialog(cfgFN);
DialogResult dr = ld.ShowDialog();
if (dr == DialogResult.Cancel)
When I execute the above code so and the user hits the Exit button, the app exits, but I get an ObjectDisposedException before it actually exits. If I chang:
the app will return without this error. But this code just doesn't look right to me. What is the proper way to exit from a CE .Net application? Are either of the above correct?