How to select specific data from listbox?

In VB2008, I'm trying to create a radiobutton that only is usable when I select a certain item in a listbox.?

  • What I mean is that I want to create a radiobutton that is usable only after I select a certain item in the listbox. Like, let's say one of the items in the listbox has two different shapes/forms and I want VB2008 to activate a groupbox with two radiobuttons in it only when I select that item so that I can select just one of its forms.

  • Answer:

    This is from VB 2005 but I think it will still work. I created a list with just some different letters as items and then had it activate the radio buttons (in a panel) when "s" was selected from the list. You can of course select in any way you want as this is just a dumb example. I used the SelectedIndexChanged event and then either enable or disable the panel. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged If (sender.selecteditem = "s") Then Panel1.Enabled = True Else Panel1.Enabled = False End If End Sub

Jon G at Yahoo! Answers Visit the source

Was this solution helpful to you?

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.