Using the .NET compact framework, you can create a modal dialog as you would for a desktop app. There’s a problem, however, on Windows Mobile. Perhaps it’s with the .NETCF itself. You can use the ‘switcher bar’ to get back to the parent of a modal dialog, and then close it! When you press the close (‘OK’) button, the app crashes with an unhandled ArgumentException.

I can’t find a way to catch the exception. Perhaps this means that the only way to do ‘modal’ dialogs in .NETCF is to get rid of ‘parent’ forms before you show them? Maybe there’s a better way, such as disabling the close button on the ‘parent’ form. We’ll see...

No comments