T
tbrown
I have a combobox with items like this: {one,two,three}. The selected
index is 0, so "one" appears in the combobox text. When the user drops
down the list, and selects "two", for example, I modify the Items
collection to be {two,one,three} and now want "two" to appear in the
combobox text. However, the combobox text is now blank. the is apparently
somehow the result of having changed the combobox.Items collection.
If, trying to fix this, I manually do this:
combobox1.SelectedIndex = 0;
This reinvokes the SelectedIndexChanged event and I am in an infinite
loop. The same thing happens if I change the text property of the
combobox instead of the selectedindex.
The behavior I am trying to accomplish is a drop down substitution list
for a basketball scoring program. The players in the game are listed in
combo boxes, and each combobox contains the set of players that could be
substituted for that player, so it dynamically changes whenever a
substitution is made.
Any ideas?
Terry Brown
Stickman Software
www.stickmansoftware.com
index is 0, so "one" appears in the combobox text. When the user drops
down the list, and selects "two", for example, I modify the Items
collection to be {two,one,three} and now want "two" to appear in the
combobox text. However, the combobox text is now blank. the is apparently
somehow the result of having changed the combobox.Items collection.
If, trying to fix this, I manually do this:
combobox1.SelectedIndex = 0;
This reinvokes the SelectedIndexChanged event and I am in an infinite
loop. The same thing happens if I change the text property of the
combobox instead of the selectedindex.
The behavior I am trying to accomplish is a drop down substitution list
for a basketball scoring program. The players in the game are listed in
combo boxes, and each combobox contains the set of players that could be
substituted for that player, so it dynamically changes whenever a
substitution is made.
Any ideas?
Terry Brown
Stickman Software
www.stickmansoftware.com