Where's the dropdown list of events in Visual

2020-02-15 05:44发布

问题:

This article mentions the availability of a dropdown of default event handlers in Visual Studio (C#). I can't find it. What is in-line code? I am assuming C# code inside the aspx file? I tried that and there was no dropdown.

Read the line just below the first grey box. I am using VS 2008 SP1.

回答1:

Are you talking about this panel? This lists all the events for a given control when in the Designer. You can access it by clicking the "Events" button in the Properties panel (see 1). Double-clicking in the field (2) causes Visual Studio to automatically generate a method stub.

Alternatively, if you're viewing the code, you can type the name of the control followed by "." to activate Intellisense, select the event you want to handle, then type "+=" and press Tab twice to achieve the same effect.



回答2:

To see the dropdown list with the event's you have to switch to the design view, then open the properties pane. There you will find a toolbar button (a yellow flash), that will display the events of the selected control. By double-clicking an entry, an event-handler is added to the code-behind.



回答3:

See this: Events tab randomly appears and disappears in VS 2008



回答4:

This and the feature to generate event handlers without having to switch to Design view is finally coming in Visual Studio 2012.