开发者

Available class events C#

in c# how can I get the available ev开发者_开发知识库ents of a class in order to begin programming code inside of it. I know that in form or usercontrol you can select the control and click the events button and click on the selected event to begin coding, but I mean a derived class which I want to code its methods or events.

Thanks!


The simplest way is to look in the documentation, to be honest.

If you're within the designer, your approach of using the properties window will work for other controls (buttons, textboxes etc) as well... and if you're in the IDE, you can type this. from any instance context (e.g. the constructor) and get a list of members up, including the events.

I would still suggest reading the documentation though - MSDN allows you to look at all members, or just the events (or methods, or whatever) at any one time. It's not terribly hard to peruse the list that way - and you can then check the details of the event so you can make sure you're using it properly, rather than just by guessing based on the name.

EDIT: As Aren mentions, there's also the Object Browser. Not my personal preference, but it's an option.


The events are listed in the IntelliSense popup window you'll get when you type the class reference variable name followed by a dot. They have a lightning bolt icon.

Many more organized ways to know what a class can do. You could read its documentation. Or browse its source code. Or use Reflector if there isn't any.


in Visual Studio 2010, they have got this new Help Library Manager where you can check for MSDN updates and download any updates or go to online directly. (you can also install Vendor API docs quite easily as well)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜