0

I need to to this: If the selected option / item is "Enabled" I want to preview a textbox.

I've tried this:

        If ComboBox6.SelectedItem = "Enabled" Then
            TextBox10.Visible = True
        Else
            TextBox10.Visible = False
        End If

And also this:

        If ComboBox6.Text = "Enabled" Then
            TextBox10.Visible = True
        Else
            TextBox10.Visible = False
        End If

Thanks in advance,
Isaac

PS: I'm using DropDownList

Edited by IsaacMessi10

2
Contributors
3
Replies
20
Views
4 Years
Discussion Span
Last Post by Reverend Jim
0

Is the code in the ComboBox6_SelectedIndexChanged event handler? If so it should work. It works just fine for me (vb 2010). Iincidentally you can shorten the code to

TextBox10.Visible = (ComboBox6.Text = "Enabled")

You don't need the parentheses but if you leave them out it looks like a multiple assignment.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.