i'm used to have the IDE to create the event signature for me under vb.net, how to do it with c#?
for the past >8 years i was doing VB
/ VB.Net
work
now I'm jumping into C#
world, so far it's very easy
only thing that I find 开发者_C百科difficult is the fact that the signature of every events on object are not automatically created for me.
I'm used to select the object name in the left dropdown in the code view and then the event that I want in the right dropdown.
is there something similar to that in C#
? if yes where can i find it, I really wish I don't have to write them by hand...
Yes there is: Type the event name followed by += followed by a space and then hit tab twice. Example:
someControl.Click += <hit tab twice>
this will create the event handler method stub for you.
The closest in C# is tab completion. While adding an event, press tab to complete the event signature:
and another tab to create the event handler.
if you are in the design view you can select the object you want then in the properties window you can click on the events button(i think it looks like a lightning bolt). then double click in the area to the right of the event you want.
精彩评论