0

I have 5 combo boxes. They each contain part of a Configuration Number. I would like them to update after one of them has been selected (narrowing down the options to the new set of possibilities).
I've looked here and here. The first of which is entirely useless, and the second just leads to a dead end.

My current code for the event handler looks like this

Private Sub cbNumberOfModules_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbNumberOfModules.SelectedIndexChanged
    ReduceArrayOfConfigs(cbNumberOfModules.Text)
    cbNumResLeft.Items.Clear()
    cbNumResRight.Items.Clear()
    cbResLeft.Items.Clear()
    cbResRight.Items.Clear()
    BuildComboBoxSelectFunction(2)
End Sub

However this doesn't seem to be updating the Combo Boxes.

The function ReduceArrayOfConfigs simply siphons out the unwanted configuration numbers based on the choice of the user.
The BuildComboBoxSelectFunction(2) adds a set of possible values based on the configuration numbers in the reduced array.

My initial thought was if I clear the Combo Boxes I can then simply do cb.Item.Add and it will update them. I'm now assuming this is incorrect and I need to refresh them or something?

Thanks for your help!

Community
  • 1
  • 1
Edlothiad
  • 133
  • 1
  • 6
  • what if you comment out BuildComboBoxSelectFunction(2) - does it then clear the text boxes? I'm thinking that maybe it clears them, then repopulates with all the same stuff again – Cato Jul 26 '16 at 14:19
  • Oh my I'm stupid. That's what was going wrong. I was repoplulating with the same content because I stored the reduced array in a new array. Thanks! – Edlothiad Jul 26 '16 at 14:21

0 Answers0