VB如何设置控件的Visible属性

2024-11-18 14:05:59
推荐回答(5个)
回答1:

没有visible,此是让控件可见或不可见(true
or
false),没有index,此是索引,比如你在窗口上画一个按钮,选中它,然后右建菜单,选择复制
在这个窗口的空白处选择右键菜单<粘贴>,此时会提示是否要创建控件数组,如果你选择是
此时原来的那个控件的index=0
当前粘贴出来的index=1,
那么他们的name(名称)属性都一样,要找到这两个控件,就得用索引来找

回答2:

Private Sub Option1_Click()
If Option1.Value = Ture Then
Text.Visible = Ture
else
Text.Visible = False
End If
End Sub

Private Sub Option2_Click()
If Option2.Value = Ture Then
Text.Visible = false
else
Text.Visible = true
End If
End Sub

再两个事件里都写全就对了

回答3:

Private Sub Option_Click()
If Option.Value = Ture Then
Text.Visible = False
else
Text.Visible = Ture
End If
End Sub
----------------------------------------------
Private Sub Option1_Click()
If Option1.Value = Ture Then
Text.Visible = Ture
Option2.Value = false

End If
End Sub

Private Sub Option2_Click()
If Option2.Value = Ture Then
Text.Visible = False
Option1.Value = False
End If
End Sub

你在试试~~~
你怎么不用一个options 控制text的visiable属性

回答4:

不用click事件,换用 CheckedChanged 试试

回答5:

Private Sub Option1_Click()
Text4.Visible = Option1.Value
End Sub

Private Sub Option2_Click()
Text4.Visible = Option1.Value
End Sub