Addin combobox reset

3034
3
08-06-2015 07:58 AM
MichaelStranovsky
Occasional Contributor

I have created an addin with a toolbar that contains two comboboxes.  Does anyone know how to reset the combobox when a selection is made from the other one.   For instance, i select an item in combobox1.  The selected item is now showing in combobox1.  I now select an item in combobox2.  The selected item in combobox2 is now showing, but combobox1 also still shows its previous selected item.  I would like combobox1 to reset to the initial state when i select an item from combobox2.

Initial Toolbar State:

InitialState.jpg

After Landscape has been selected:

LandscapeState.jpg

After Portrait has been selected, i want the landscape11x17 to go back to the initial state:

LandscapePortraitState.jpg

As you can see it is not.

Tags (2)
0 Kudos
3 Replies
RichardMoussopo
Occasional Contributor III

if Landscape is the first option in your combobox, then you can reset it using comboBox1.selectedIndex = 0

If you do not want anything selected, then use comboBox1.selectedIndex = -1, with comboBox1 the instance name of your ComboBox.

MichaelStranovsky
Occasional Contributor

If I am using the addin combo box which inherited the combo, how can i gain access to it's selectedindex property?

0 Kudos
YuanLiu
Occasional Contributor

Please find a small example of add-in combo box onselchange method at http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/OnSelChange_Method/001v...