我想问一下如何用VB中的组合框控制对象。
所以我有一个有两个选项On和Off的组合框。
如何使用组合框启用和禁用文本框?
答案 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