M
moondaddy
I'm running VS2005 Team Arch. and winfx beta 2. I have a c# project windows
application so I assume this is the right this is the correct forum rather
than a vista forum.
I added a windows form to the project and double clicked on it. It opened
the code window and added the Load event. I tried to find the form Closed
event from the methods dropdown list in the top right hand corner, but
didn't see it. I'm used to seeing such events in vs 2003 vb projects. so I
added it by hand like this:
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
}
Now I deleted the Form_Load event and built the project, but I got a compile
error saying it could not find the load event. this compile error was in
the Form1.designer.cs file:
this.Load += new System.EventHandler(this.Form1_Load);
with a blue squiggly under Form1_Load. (obviously this line should have been
cleaned out when I deleted the event)
Additionally, I noticed that there was no code in Form1.designer.cs for the
Form1_FormClosed event. (it wasnt auto generated) there should be a line
like this:
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
Review:
1) What's happening is double clicking on the form auto generates the form
load event. But when I go into Form1 Partial class and remove the load
event, its not being automatically removed from the form's hidden code
behind.
2) I don't see any way to auto generate the form closed event so no code is
being added to the form's hidden code behind, and there should be code there
such as:
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
I never experienced this type of behavior in VB and I'm new to c# as well as
working with the winfx beta products so I don't know if this is a bug, or if
c# works this way, or if something in winfx beta 2 corrupted vs 2005.
any help would be great.
Thanks.
application so I assume this is the right this is the correct forum rather
than a vista forum.
I added a windows form to the project and double clicked on it. It opened
the code window and added the Load event. I tried to find the form Closed
event from the methods dropdown list in the top right hand corner, but
didn't see it. I'm used to seeing such events in vs 2003 vb projects. so I
added it by hand like this:
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
}
Now I deleted the Form_Load event and built the project, but I got a compile
error saying it could not find the load event. this compile error was in
the Form1.designer.cs file:
this.Load += new System.EventHandler(this.Form1_Load);
with a blue squiggly under Form1_Load. (obviously this line should have been
cleaned out when I deleted the event)
Additionally, I noticed that there was no code in Form1.designer.cs for the
Form1_FormClosed event. (it wasnt auto generated) there should be a line
like this:
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
Review:
1) What's happening is double clicking on the form auto generates the form
load event. But when I go into Form1 Partial class and remove the load
event, its not being automatically removed from the form's hidden code
behind.
2) I don't see any way to auto generate the form closed event so no code is
being added to the form's hidden code behind, and there should be code there
such as:
this.FormClosed += new
System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed);
I never experienced this type of behavior in VB and I'm new to c# as well as
working with the winfx beta products so I don't know if this is a bug, or if
c# works this way, or if something in winfx beta 2 corrupted vs 2005.
any help would be great.
Thanks.