Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form_load event issue 1

Status
Not open for further replies.

alex5935

Programmer
Oct 24, 2007
13
US
I am new to windows forms and trying to use form_load event. See code bellow.

private void Form1_Load(Object sender, System.EventArgs e)
{
MessageBox.Show("TEST");
}

When the window's form is showing up, nothing is happening.

I would appreciate your suggestions.
 
Do you have the event set up right? I just tested that code on one of my forms and it worked fine, make sure there is an event handler set up to handle the loading event
 
You'll want to have this in the constructor

Code:
this.Load += new System.EventHandler(this.Form1_Load);
 
Or click on your form in the designer, go to the lightning bolt symbol above properties and double click on Form Load.

This will wire up your event for you.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top