Hello
Now i have try create an click event in a form,so i doubleclick the form,but
the IDE create an form_load event automatic:
private void Form2_Load(object sender, System.EventArgs e)
{ }
but the code i need is:
private void Form2_Click(object sender, System.EventArgs e)
{ }
so i had write it by hand,but it not work,i find some books,and add some
codes:
this.Click += new System.EventHandler(this.Form2_Click);
Haha,it work,but how can IDE create an click event automatic,not with
handwrite?
Herfried K. Wagner [MVP] - 14 Feb 2005 15:48 GMT
"Baboon" <woshimqw@hotmail.com> schrieb:
> Now i have try create an click event in a form,so i doubleclick the
> form,but the IDE create an form_load event automatic:
Select the form/control and click the small lightning button in the
properties window. Choose the desired event and add a handler.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Baboon - 14 Feb 2005 16:44 GMT
Thanks you answer! But it doesn't work correct.
I click the lightning button ,it take me to the event's load,what is show me
is an empty combBox,i write an event "Form_Click",push enter ,the IDE create
code:
private void Form1_Click(object sender, System.EventArgs e)
{
}
and other code in InitializeComponent:
this.Load += new System.EventHandler(this.Form1_Click);
then i complet the code,push F5,debug it .
Now something which i hope to happen when i click done already,it happen
when the form load,so i change the code:
this.Load += new System.EventHandler(this.Form1_Click);
to:
this.Click += new System.EventHandler(this.Form1_Click);
then the program done with my wish.
It's so interesting,i don't know why?
Don't tell me i need to format the c:/ and install the VS again,it not a
good idea!
Christian Wilhelm - 15 Feb 2005 10:20 GMT
Hi Baboon,
just double-klick in the comboBox of the desired event then vs.net will
create the code pattern for you automatically.
Sincerly,
Christian
> Thanks you answer! But it doesn't work correct.
>
[quoted text clipped - 19 lines]
> Don't tell me i need to format the c:/ and install the VS again,it not a
> good idea!
Baboon - 15 Feb 2005 14:15 GMT
Thanks very much!
I find the correct comboBox,and it done with my wishes.
Thanks again!!!