PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Re: How to update main form when child form closes?

Reply

Re: How to update main form when child form closes?

 
Thread Tools Rate Thread
Old 30-03-2004, 10:41 AM   #1
Thomas
Guest
 
Posts: n/a
Default Re: How to update main form when child form closes?


Try calling Application.DoEvents (or is it Application.ProcessMessages -
can't remember right now?) after closing the dialog box.
This allows for the repaint events to be processed by the main form.


"Mike Litzkow" <mlitzkow@buildstuff.com> wrote in message
news:85B642B6-C114-4164-9A7E-8FB8D0F0B371@microsoft.com...
> My windows desktop app has a main form which puts up an "Hourglass"

cursor, calls "Update", and then calls a routine in another class to do some
fairly extensive processing. This works fine except when the called routine
runs into a problem. Then it will put up a dialog box asking the user if
it's OK to fix the problem. This causes the "hourglass" cursor to change
back to a normal "pointer" for the duration of the new dialog. That's fine
too, but when the dialog finishes the cursor remains a "pointer" cursor and
the main form doesn't redraw where the dialog box was. I think I need to
call Update in the main form at this point, but how should I do it? Passing
a reference to the main form all the way down to the point where the error
is handled and the dialog box is shown will be quite akward. Likewise,
passing an event from the error handler back up to the code in the Main Form
looks akward too. Is there another way?


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off