[Help]ComboBox Selection[Solved]

Posts 1–13 of 13 · Page 1 of 1
[Help]ComboBox Selection[Solved]
Say i had a comx right?
And then i wanted a TextBox to be visible once a certain item of the Comx is selected. How would i do that.
Quote Originally Posted by Invidus View Post
Say i had a comx right?
And then i wanted a TextBox to be visible once a certain item of the Comx is selected. How would i do that.
[php]If COMBOBOX1.SelectedIndex = 0 Then
TextBox1.visible=false
else
textbox1.visible=true
end if

[/php]
Thanks MJ, i'll test now
Mj's code will visible on any selected change

Try , For a specific item it will be

[php]
If Combobox1.selecteditem = "Item Here" Then
Textbox1.Visible = true
End if
[/php]

or use selected index (knowing which index you want it to display on)

[php]
If combobox1.SelectedIndex = 1 Then 'or the index you want to display the textbox
TextBox1.visible=true
else
textbox1.visible=False
end if
[/php]
Thanks NextGen, i think its working nao =D
LOL, That was just an example on how to change visibility using indexes

I was so tired that writing a single line was difficult for me at that time hehe
I would try if my vb worked :P

Thanks this will become helpful
definitely =D.
Idk why but I prefer using textchanged

Code:
 Private Sub ComboBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
      
  If ComboBox2.Text = "Whatever" Then
textbox1.visible = true
else
textbox1.visible = false
end if
        
    End Sub
That could work, but in my case i'd prefer to use NextGen's solution. Thanks for sharing though Blubb =D
My pleasure...

Fine, both solutions are possible :P

Depends on what you prefer
Yes! And also the situation!
Not a problem, Marked Solved

Left Open for other users
Posts 1–13 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us