我们如何以我们使用的形式获取用户控件的事件? [英] how can we get the events of user controls in the form where we are uysing it?

查看:53
本文介绍了我们如何以我们使用的形式获取用户控件的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何以用户使用的形式获取用户控件的事件?

how can we get the events of user controls in the form where we are uysing it?

推荐答案

1.在用户控件中创建委托.
2.在用户控件中创建此委托类型的事件
3.每当它应在用户控件中通知订阅者时引发事件.
4.订阅页面中的事件.
5.在页面中处理事件.

这是一个可以帮助您的小代码段:

> http://stackoverflow.com/questions/943794/handling-user-control- events-on- Containing-page [ ^ ]
1. create a delegate in user control.
2. Create an event of this delegate type in the user control
3. raise the event whenever it should notify subscribers in the user control.
4. subscribe to event in page.
5. handle the event in page.

Here is a small code snippet that could help:

http://stackoverflow.com/questions/943794/handling-user-control-events-on-containing-page[^]


这篇关于我们如何以我们使用的形式获取用户控件的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆