VB 2010 .NET ComboBox如何控制对象Whit这个?

时间:2017-08-17 13:30:55

标签: vb.net

我想问一下如何用VB中的组合框控制对象。

所以我有一个有两个选项On和Off的组合框。

如何使用组合框启用和禁用文本框?

1 个答案:

答案 0 :(得分:0)

   you can try something like this

private Sub OrainsComboBox3_SelectedIndexChanged(sender As Object, e As EventArgs) Handles OrainsComboBox3.SelectedIndexChanged
            If OrainsComboBox3.SelectedText = "On" Then 
             OrainsTextBox7.Enabled = True
             OrainsTextBox8.Enabled = True 
          End If 
          If OrainsComboBox3.SelectedText = "Off" Then 
             OrainsTextBox7.Enabled = False 
             OrainsTextBox8.Enabled = False 
          End If 
            End Sub