Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
In VB.NET does the Form_Load event still function. I try to tell the program to execute code as the form loads but nothing is happening. Is Form_Load still optional? Any help with this question would be greatly appreciated.
  • *Experts*
Posted

You can't simply make a sub called Form_Load; it needs to be told to handle the event. Assuming you have the IDE, choose '(Base Class Events)' from the top-left combo in the code window, and choose 'Load' from the right one. The IDE will wire the event for you. You should take notice that it requires a sender object (that's the object that invoked the event), an eventargs object (used as an alternative to a list of parameters), and a Handles statement to tell it the actual event to handle. You no longer need for the sub to be called Form_Load; you can call it anything you want as long as you tell it to Handle Form.Load.

 

Consult your MSDN for more info. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...