justin creasy wrote:
Try placing an Application.DoEvents(); after the .ShowDialog() line.
Also, is this a multi-threaded application where maybe the threads are
not background threads? Just some thoughts.
nick_nw wrote:
Hi All,
I think I'm missing a basic bit of understanding with modal forms.
This is the problem I have:
1. User clicks button on form, event handler throws an exception.
2. In catch block a form is shown modally (i.e. errForm.ShowDialog
()).
3. When the user closes the dialog the form image stays on the screen
and the app stops painting.
I'm using C# with .Net 1.1. This isn't repeatable and try as I might I
can't get this to reproduce in a small sample app (which suggests a
problem with my 'big' app). What I'd like, is a detailed discussion of
modal forms. Does anyone have such a resource?
Many thanks,
Nick Gardner
http://seecharp.blogspot.com/
Hi, thanks for the replies.
The catch bloc looks like this:
catch (Exception ex)
{
errForm = new errForm ();
errForm.Exception = ex;
errForm.ShowDialog ();
}
I've tried calling Application.DoEvents () to no avail.
I've tried all possible combinations of control.Invoke and BeginInvoke
(even though I've proven that all operations are on the main GUI
thread).
There is something else happening that can't be solved in a short code
sample. I do not say this lightly but I suspect a bug in the .Net 1.1
framework. Unfortunately I can not produce a small test program that
reproduces the bahaviour (I know how this sounds, must be my app right?
Look, I'm not ruling anything out).
What I want is to develop an in depth understanding of modal forms.
What would be the best resource (short of Rotor, CLR specs, and other
such dry sources)?
Many thanks,
Nick