我的UserControl的控件处于非活动状态 [英] my UserControl's Controls are Inactive

查看:109
本文介绍了我的UserControl的控件处于非活动状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友

我创建了一个UserControl,它的拐角处有一个groupBox和一个checkBox.
目的是在checkBox.Checked更改时启用/禁用groupBox中的控件.

我的问题是:

当我在窗体上添加一个拖动userControl的实例时,添加到该控件中的控件将不会放置在groupBox.Controls集合中.

请帮我的朋友们.我知道它没有出现,但是确实发生了.

Dear friends

I create an UserControl which has a groupBox and a checkBox in the corner.
The Purpose is to enable/disable the controls in the groupBox when checkBox.Checked changes.

My problem is:

When I add an instance of drag an userControl on a Form, the controls that I add to it, won''t place in groupBox.Controls collection.

Please help me friends. I know it doesn''t make scene but really it happened.

推荐答案

1-这没有任何意义.切勿公开控件,公开属性以更改您要允许的内容.但是,是否启用与类修饰符无关

2-如果将控件添加到组框,那么它们肯定会在控件内部,而不是包含它们的表单中吗?
1 - this makes no sense. NEVER make controls public, expose properties to change the things you want to allow. But, if it''s enabled or not has nothing to do with class modifiers

2 - If you add controls on to the groupbox, then they will be inside your control, not inside the form that holds them, surely ?


这篇关于我的UserControl的控件处于非活动状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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