如何从用户控件访问父控件 [英] How to access a parent control from user control
本文介绍了如何从用户控件访问父控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试从用户控件调用父页面控件.如何从用户控件页面在父页面中设置控件的属性.
I am try to call a parent page control from user control.How can set a property of a control in the parent page from user control page.
推荐答案
我不知道你到底是什么意思.
这是来自应用程序吗?如果是这样,则UserControl属性上有一个父属性,它为您提供了主机控件.使用它来获取所需的属性.
I don''t know exactly what you mean.
Is this from an application? If so, there is a parent property on the UserControl property, which gives you the host control. Use that to grab the property you want.
尝试
从子控件访问父控件的方法 [
Try
Access Parent Control''s Method from a Child Control[^]
这篇关于如何从用户控件访问父控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文