Windows Develop Bookmark and Share   
 index > Windows Forms General > Running Code on Form Load
 

Running Code on Form Load

I am trying to run some code after my form loads, without having to click a button. I have tried the OnLoad event and Activated Event as well as the myForm.Show() method, however, only the outline of the form loads until all the code is done and then it ends. For some reason non eof the child controls on the form load up (just the outlines). Any and all help would be greatly appreciated (as well as any code snippets). 

Thanks...Mike.
MigrationUser 1  Tuesday, August 10, 2004 2:00 PM
Try putting this line of code in the beginning of OnLoad, it worked for me :-)

Application.DoEvents();

Brian
MigrationUser 1  Thursday, August 12, 2004 2:21 AM

You can use google to search for other answers

Custom Search

More Threads

• common open dialog
• Tough Reflection Question
• [DataGrid] Avoid to sort a column
• Messege box in VB .net 2003 windows form
• C# windows form looks different on different OS/Platform
• problem with WebBrowser control
• Unknown number of items in a listbox
• I need ideas for Flip3D and GDI+
• ListView.CheckedItems does NOT function!
• switching between windows forms