how to access addin combobox.selected

Discussion created by michaeltischler on Aug 31, 2012
Latest reply on Mar 28, 2014 by abarkhur

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?