如何使CHECKBOX表单运行时可见错误 [英] How to make CHECKBOX Form Run Time Visible False

查看:102
本文介绍了如何使CHECKBOX表单运行时可见错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



如何以男性形式加载所有复选框可见错误



Hi All

How to Male Form Load All Checkbox Visible False

For Each Control In Me.Controls
            If TypeOf Control Is CheckBox Then
                Control.visible = False
            End If
        Next Control



请告诉我..


Please Tell me..

推荐答案

关于第一个看,你的代码似乎没问题。我只会改变这一行:

On the first look, your code seems to be OK. I''ll change only this line:
If TypeOf ctr Is System.Windows.Forms.CheckBox Then





BTW:永远不要使用如下名称:Control等作为变量的名称,因为Control [ ^ ]定义控件的基类,它是具有可视化表示的组件。



更多关于 TypeOf 运算符: http:/ /msdn.microsoft.com/en-us/library/0ec5kw18.aspx [ ^ ]



BTW: Never use names like: Control, etc as name of variable, because Control[^] defines the base class for controls, which are components with visual representation.

More about TypeOf operator: http://msdn.microsoft.com/en-us/library/0ec5kw18.aspx[^]


这篇关于如何使CHECKBOX表单运行时可见错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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