Doing work after the window has displayed.

C

clintp

I have a form, and I need to do some processing after the form has
displayed. The processing could take a few moments and could result in
a dialog box being displayed.

The problem is, I can't seem to find the event (to insert my
processing) that happens after the form has displayed. Back in the
main body of my code I instantiate the form:

MyForm mf = new MyForm();
if (mf.ShowDialog())
{ .... }

And inside of MyForm I've tried catching VisibleChanged (with Visible =
true) and that doesn't work. It does the processing, but the form
doesn't display before processing starts.

This is important, becuase if the processing turns out in a particular
way I might not have to have the user interact with the form at all! I
just need to display a message, set MyForm.DialogResult and close the
window. But I can't if it's not open yet.

Help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top