what method is called before a winform is rendered to the screen

I am new to windows forms application programming. When my web form is initially displayed, I need it to automatically call a method which will load a GridView control on the page. If I were writing a web application, I could do this using the OnPageLoad method, or the Init method. In windows form programming I have no idea how to have a method called before a web form is rendered to the screen. So how can this be done in VB .net? I thought I read about a main method, but am not sure about that, since that method is not autogenerated when I create a winform page.
LVL 2
brgdotnetcontractorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you can try look into Form_Load event

Differences Among Form's Initialize, Load, and Activate Events
https://support.microsoft.com/en-us/kb/138819
brgdotnetcontractorAuthor Commented:
Hi Ryan, is there a way to autogenerate the load method in the IDE? Or do I manually have to create it?
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
You can double click the form itself and it should autogenerate the Form_Load event in your IDE.

or you can go to the form properties or the code editor to add the Form_Load event there accordingly.

(an image from web shows where is it)
http://1.bp.blogspot.com/-ImgkTL6cK3Y/UInQdNvRoaI/AAAAAAAAAgw/Oc9ZdVZm1zA/s1600/image003-776831.png

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
käµfm³d 👽Commented:
Just keep in mind that if you use Form_Load, then nothing will be displayed on the screen--no form at all--until the loading of the GV completes. This has to do with how Windows messaging works (search for "Windows message pump" for more information). If you have access .NET 4.0 and above, then you might consider using the new Task Parallel Library to load the GV asynchrounously. It would of course depend on your requirments (e.g. maybe you don't care that the form doesn't show for X number of seconds while the GV loads).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.