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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call function right after form is visible

Status
Not open for further replies.

Serenades

Programmer
Oct 3, 2001
21
SE
Hi,

I need to call a function right after the form is visible.
I dont want the user to click anything, the program should be run automatic.

Well, i dont know where to put my call... Main(), WinForm_Load, WinForm...

Ive tried some but i only get this errors:
An object reference is required for the nonstatic field, method, or property 'genFiles.WinForm.genFiles()'

Best regards
Robert
 
Hi there!

Found a way.
<code>
private void WinForm_Load(object sender, System.EventArgs e)
{
// Make sure window is visible //
this.Show();
this.Select();

// Call function //
genFile();
}
</code>

Thanks for fast responses!

//Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top