Re: Run a method after a form appears

From: Jordan Irwin via DotNetMonster.com (forum_at_DotNetMonster.com)
Date: 11/10/04


Date: Wed, 10 Nov 2004 22:38:25 GMT

Option 1:
Try calling Application.DoEvents(); at the end of your Form_Load event. Then call your method.

Option 2:
Try using the Validated event. This triggers after a form has been painted I believe.

Option 3:
You could start a timer in the load event (or instantiation) that checks a flag. When the flag becomes true, then the timer stops and triggers your method. Flag defaults to false, and set to true at the end of the Form_Loaded event. You may even put a small delay after the flag is true. This is a very messy way to handle it though.

*****************************************
* A copy of the whole thread can be found at:
* http://www.dotnetmonster.com/Uwe/Forum.aspx/dotnet-compact-framework/9104
*
* Report spam or abuse by clicking the following URL:
* http://www.dotnetmonster.com/Uwe/Abuse.aspx?aid=3c6fd90b625446c686d8a0674d411da5
*****************************************