473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Loading a form

Hello,
I created a form and excpected to see in a windows designer generated
code something like this:
this.Load += new System.EventHandler(this.Form1_Load);

as I saw in other projects.
But I don't see it and I need it in order to do things while the form
loading.
How can I add it and where it appears?
Thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
1 1368
Hi juli,

If you double click on the Form the designer will add a handler to the default event for that control as well as the method.

You can also add it manually

this.Load += new System.EventHandler(this.Form1_Load);

private void Form1_Load(object sender, EventArgs e)
{
// Add code here
}

Or, since you most likely are coding inside the Form1 class

protected override void OnLoad(EventArgs e)
{
// Add code here, note no += EventHandler needed
}
On Mon, 09 May 2005 18:38:31 +0200, juli jul <ju******@yahoo.com> wrote:
Hello,
I created a form and excpected to see in a windows designer generated
code something like this:
this.Load += new System.EventHandler(this.Form1_Load);

as I saw in other projects.
But I don't see it and I need it in order to do things while the form
loading.
How can I add it and where it appears?
Thank you!

*** Sent via Developersdex http://www.developersdex.com ***


--
Happy coding!
Morten Wennevik [C# MVP]
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Curious George | last post by:
I have a page that takes about 10 seconds to load the first time it is run. I would like to first display a little animated gif telling the user that the page is loading. How do I do this with...
2
by: Rob | last post by:
I was working on a project and everything was going fine, then all of a sudden the form set as my startup object stopped loading. I tried setting some others as the startup object, and some of my...
3
by: Holmes | last post by:
Hello Ran into a bit of a problem here and have now exhausted my resources to getting this working What I am trying to do is load and show a simple vb form with a listbox in it Dim...
5
by: Cerebrus | last post by:
Hi all, I have an Windows application in which the startup form is called "MainForm". Now when this form loads, I need to do some intensive tasks like loading and parsing an XML file, that takes...
4
by: Amarantine | last post by:
I have a from and a subform and I need to stay on the same record when I move from the main form to the subform. I have a "next" button with a macro on the last page of the form which navigates to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.