how to access addin combobox.selected

3200
2
08-31-2012 06:40 AM
MikeTischler
New Contributor II
Hi,

I'm sure I'm making this more complicated than it needs to be.  I am creating an addin toolbar with a button and combobox.  I'm populating the combobox with all the layers in the TOC.  When the button is clicked, I'd like to perform some action on the layer selected in the combobox.

For the life of me, I can't figure out how to get the selected item from the combobox from inside the OnClick() event of the button.


ArcGISAddin2 is my combobox, with GetComboBox() :

 Friend Shared Function GetComboBox() As ArcGISAddin2
        Return s_comboBox
    End Function



The below doesn't work to get the property of the combobox, because "'ESRI.ArcGIS.Desktop.AddIns.ComboBox.Protected ReadOnly Property Selected() As Integer' is not accessible in this context because it is 'Protected'."
 Dim selCombo As ArcGISAddin2 = ArcGISAddin2.GetComboBox()
 i = selCombo.selected




Could somebody please give me a hint as to how to access the text or cookie in the combobox?

thanks,
Mike
0 Kudos
2 Replies
AysberqTundra
Occasional Contributor
0 Kudos
AaronBarkhurst
New Contributor
Mike,

Did you come up with a solution for this? I'm just now getting into an almost identical tool and if I can get a spring board on this that would help.
0 Kudos