如何访问用户控件属性

编程入门 行业动态 更新时间:2024-10-11 23:21:24
本文介绍了如何访问用户控件属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好. 这是我的问题... 我有2个标签的用户控件 我想访问父页面代码背后的标签之一的text属性,该标签使用usercontrol我该怎么做?

HI guys.. here is my question... I have a usercontrol with 2 lables I want to access the text property of one of the lable in my codebehind of parent page which uses usercontrol how do I do that??

推荐答案

属性... get /放... !?希望这样就足够了. Properties...get/set... !? Hope that should be enough.

听起来好像标签不允许公共访问,在设计视图中默认情况下将其设置为private.您可能需要为标签创建一个获取/设置: It sounds like the label does not allow public access, by default in design view it is set to private. You probably need to create a get/set for the label: public label lYourLabel { get; set; }

检查子控件的可访问性

更多推荐

如何访问用户控件属性

本文发布于:2023-11-09 21:22:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1573470.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   属性   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!