如何在用户控件公共中进行控件 [英] How to make controls in the User Control public

查看:62
本文介绍了如何在用户控件公共中进行控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了自己的用户控件并加载到表单中。

I made my own user control and loaded into a form.

我可以访问该用户控件但不能控制每个用户控件。

I can access that user control but can't each controls inside the user control.

控件的默认访问修饰符是私有的,因此我无法直接从加载了用户控件的表单进行访问。

The default access modifier of the control is private, so I can't access directly from the form on which the user control is loaded.

我可以更改私有公开,但有什么方法可以在我最初进行用户控制时设置这些公开? 

I can change private to public but is there any way to set those public when I make the user control initially? 

推荐答案

执行此操作的方法与您一样已经学会了,在控件的属性窗口中将修改器设置为public。
The method to do this is as you have learned, set the modifier to public in properties window of the control(s).


这篇关于如何在用户控件公共中进行控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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