将值从表单传递给用户控件 [英] Pass value from a form to a user control

查看:78
本文介绍了将值从表单传递给用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用事件/代理将值从表单传递给用户控件?我只知道从用户控件传递到表单...我知道属性,但我想知道是否可以使用事件...



谢谢。

How i pass value from a form to a user control, using events/delegates ? I only know pass from user control to form... I know with property, but i want to know if it's possible using events...

Thanks.

推荐答案

是 - 它与表单完全相同 - 使用属性:在两种形式之间传递信息,第1部分:父母对儿童 [ ^ ]父亲就是表格,如果是用户控制就是孩子。

如果您想采取其他方式:在两个表单之间传输信息,第2部分:孩子到父母 [ ^ ]然后哟你可以使用事件!
Yes - it's exactly the same as with forms - you use properties: Transferring information between two forms, Part 1: Parent to Child[^] The parent is the form, the child if the user control.
If you want to go the other way: Transferring information between two forms, Part 2: Child to Parent[^] then you can use events!


你可以使用这篇CP文章来了解如何做到这一点......

使用代理在两个表单之间传递数据 [ ^ ]

网上有很多关于这个主题的文章......只是搜索..
You can use this CP article to get some ideas about how to do it..
Using a delegate to pass data between two forms[^]
There are plenty of articles on this topic online too... just search..


这篇关于将值从表单传递给用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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