如何使用复选框显示和隐藏控件 [英] How to show and hide control with checkbox

查看:104
本文介绍了如何使用复选框显示和隐藏控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

如何用复选框显示和隐藏控件或其他细节?

我有2张图片,链接供参考贝尔!



Hello guys !
How can I show and hide a control or other detail with checkbox ?
I have 2 image with the link for reference bellow !

http://prntscr.com/mir395
http://prntscr.com/mir365





感谢您的帮助!



我的尝试:



我不知道!

现在我就像本文一样了解Groupbox或CheckgroupBox: CheckGroupBox和RadioGroupBox [ ^ ]

推荐答案

您希望代码评估复选框的checked属性,以确定是否隐藏其他控件。



这是链接专门针对Visual Basic DotNet的复选框控件的Checked属性的文档。
You would want your code to evaluate the checked property of the checkbox to make the determination on whether to hide other controls.

Here is the link to the documentation specifically for the Checked property for a checkbox control for Visual Basic DotNet.


检查: CheckBox.Checked Property(System.Windows.Forms)| Microsoft Docs [ ^ ]



Check this: CheckBox.Checked Property (System.Windows.Forms) | Microsoft Docs[^]

Private Sub CheckBox1_CheckedChanged(sender as Object, e as EventArgs) _ 
     Handles CheckBox1.CheckedChanged

   OtherControl.Visible = CheckBox1.Checked

End Sub


将可见属性设置为复选框Checked属性。



因此,当选中复选框时,可见性设置为True

当未选中复选框时,可见性设置为false
Set Visible property to the checkbox Checked property.

So When checkbox is checked visibility sets to True
And when checkbox is unchecked visibility sets to false


这篇关于如何使用复选框显示和隐藏控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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