Microsoft Visual Studio and C#: How to Visually Add Events to Controls?

廉价感情. 提交于 2019-11-27 05:24:59
womp

In the designer, click the control of interest.

In the properties window (hit F4 to bring it up), there should be a little lightning bolt icon. Clicking the icon takes you to the list of available events for that control. Double-clicking the event name will wire up a stub handler and take you to the code-behind for it.

Edit: the astute reader will see that the posted screenshot is for a web app (whups), but it's the exact same thing for a winforms app.

All you have to do is to have the form/control open in designer view, have the control in question in focus/selected, open up the properties view and flick over to the events tab. Double click on the event that you're interested in handling.

alt text http://img222.imageshack.us/img222/4456/propv.jpg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!