views:

1251

answers:

2

Perhaps this is a stupid question, but for the life of me I cannot find a way to do this.

How would one go about adding an event handler to a control in a form in Microsoft Visual Studio (2008) with C#?

I can do it manually, but opening the Designer.cs file for the Form, but I cannot find a way to do it through the interface. In MSVC 6, with C++ and MFC, you could right click or some other action, and find a list of all the possible events for that control. Then you select it and it would bring up window letting you create a method to associate with that event. In VB it was even easier, you could do it in the code and it listed all the events in the method drop downs.

However, I cannot find anything of the sort in 2008 with C#. Intellisense helps fill in the correct method information. However, it always creates the method in the Designer.cs file, not the other half of the partial class where it should be.

Thank you.

+15  A: 
womp
How very helpful! And with a screenshot and everything. Thank you for the help.I knew it would be something simple, I guess I just didn't think to click the "lightning bolt." Ya know, cause when I see a lightning bolt I think of event handlers. Way to go Microsoft ...
morrog
+1 for the screenshot.
Adam Porad
+3  A: 
jpoh