The problem I am having is that for some reason ShowDialog returns immediately after handle an exception. However, it works for MessageBox.Show() or at the second time I call ShowDialog. What is the best workaround for this problem?
I was only able to find this. And I cannot believe that no one else has this issue.
I am using .net compact framework 3.5. Sample code:
try
{
using(SomeForm f = new SomeForm())
{
f.ShowDialog();
}
}
catch(SomeException)
{
using(SomeOtherForm f = new SomeOtherForm())
{
f.ShowDialog(); // this returns immediately
// if this is MessageBox.Show(), it works correctly.
f.ShowDialog(); // then this works fine
}
}