When I build a vb.net winforms application in VS2010, I can double click on a control on my form and it takes me to the code window. Then there are dropdown lists at the top left and top right of the code window that allow me to select the control and the event that I want to handle…
If the event handler already is already in use/defined/coded, it takes me there, otherwise it defines a new handler method with a standard naming convention (_click(blah blah blah))…
But for some reason when I build a c# application, there is no such “cheat”… call me lazy, but I don’t like having to type code that I don’t need to, and since the functionality exists in VS to “just do it”, why can’t I do it in a C# app…???
Maybe there is just a setting I need to find… anyone know of such a setting..???
Thanks
In VS2010’s C# mode, similar functionality is enabled by default. Double-clicking on a control in the visual form designer will create a default event handler for that form in the code window. This may not always be the event that you would like to handle, however. If that is the case, right-click the control in the form designer and select Properties from the context menu. A property grid will appear that contains a list of all of the control’s properties and events. Click on the lightning-bolt icon at the top of this grid to select the Events tab. From here, double-clicking on any of the event rows will automatically create a new event handler for the control in the code window.