Combo Boxes

I was wondering if it is possibly to make a combo box appear, but only when a particular option is select in a seperate combo box?

Any help would be great, thanks

Martin

Comments

  • Set the visible property to false for the combobox that you only want to see when certain items are selected (for clarity I'll refer to this box as combo2). Now create the sub (assuming that the first combobox is named combo1)
    combo1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles combo1.SelectedIndexChanged

    (this will be done automatically if you double click on the combobox)

    select combo1.selectedindex

    case 1,2,3
    combo2.visible = true
    case 3,4,5
    combo2.visible = false
    end select

    end sub
    This Sub will be called every time that the user selects an item from combo1. You can use the selectedIndex, selectedItem, selectedText or selectedValue, which ever you prefer. The values for the case statements, in this example, would be the index values where you want combo2 to appear (combo2.visible = true) and where you want it do disappear again (combo2.visible = false)

    Hope this helps
  • : Set the visible property to false for the combobox that you only want to see when certain items are selected (for clarity I'll refer to this box as combo2). Now create the sub (assuming that the first combobox is named combo1)
    : combo1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles combo1.SelectedIndexChanged
    :
    : (this will be done automatically if you double click on the combobox)
    :
    : select combo1.selectedindex
    :
    : case 1,2,3
    : combo2.visible = true
    : case 3,4,5
    : combo2.visible = false
    : end select
    :
    : end sub
    : This Sub will be called every time that the user selects an item from combo1. You can use the selectedIndex, selectedItem, selectedText or selectedValue, which ever you prefer. The values for the case statements, in this example, would be the index values where you want combo2 to appear (combo2.visible = true) and where you want it do disappear again (combo2.visible = false)
    :
    : Hope this helps
    :


    Thanks very much , thats exactly what i needed.

    Martin

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories