为什么由于其保护级别而无法访问该控件? [英] Why is the control inaccessible due to its protection level?
本文介绍了为什么由于其保护级别而无法访问该控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从program.cs访问控件的text属性,它说由于受保护的级别而无法访问。我该如何解决?
I'm trying to access a control's text property from program.cs and it says that it is inaccessible due to protected level. How can I fix this please?
推荐答案
这是控件的默认属性,可以通过以下方式解决:
This is the default property for controls and can be solved by:
- 进入包含指定控件的表单的设计视图
- 然后将控件的Modifiers属性更改为Public或内部。
这篇关于为什么由于其保护级别而无法访问该控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文