<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Combobox Selected Item in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678231#M18160</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a button add-in that I would like to read the selected value from a combobox add-in. I can't seem to be able to obtain it. I'm assuming it can be done someway, but how?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Oct 2012 20:12:45 GMT</pubDate>
    <dc:creator>JoshObrecht</dc:creator>
    <dc:date>2012-10-26T20:12:45Z</dc:date>
    <item>
      <title>Combobox Selected Item</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678231#M18160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a button add-in that I would like to read the selected value from a combobox add-in. I can't seem to be able to obtain it. I'm assuming it can be done someway, but how?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2012 20:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678231#M18160</guid>
      <dc:creator>JoshObrecht</dc:creator>
      <dc:date>2012-10-26T20:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Combobox Selected Item</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678232#M18161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Good question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is your button add-in and your combo-box add-in functionally different?&amp;nbsp; In other words, can the button and combo-box exist in the same add-in in a toolbar?&amp;nbsp; If yes, then you could create a static method in your ComboBox class that just reads and returns the selected value.&amp;nbsp; YourComboBoxClass.getMeTheSelectedValue()&amp;nbsp; Or however you want to handle it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Add-in buttons are in a different package (sorry about the Java reference) than regular framework buttons.&amp;nbsp; I'm not sure you can search for them like a command item and then get their properties, I could be wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wish I knew more about what happens during the init() method of Add-ins and how ArcMap processes those. Hypothetically, what would stop you from turning your add-in class that extends ComboBox into a Singleton?&amp;nbsp; Would you still be able to get an instance of your ComboBox add-in that way, from another Button add-in?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This might help:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000000zz000000.htm"&gt;Add-in coding patterns&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Oct 2012 19:28:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678232#M18161</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2012-10-27T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Combobox Selected Item</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678233#M18162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the button and the combobox within the same toolbar and am able to call functions between. However, the only way that I can obtain the value is by Me.Value which cannot be used in a shared function. I know I'm missing something.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2012 13:05:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678233#M18162</guid>
      <dc:creator>JoshObrecht</dc:creator>
      <dc:date>2012-10-29T13:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Combobox Selected Item</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678234#M18163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can create a shared variable on the class that gets set whenever the value changed event is triggered.&amp;nbsp; I am not keen on this sort of thing because it forces you manage an extra variable.&amp;nbsp; You can also get a reference to the other tool control item from the toolbar and cast it to a variable defined as your custom class that has the combobox and get the value from an instance method.&amp;nbsp; ToolControl items are usually singletons anyway (only once instance allowed.)&amp;nbsp; If you need to do it between difference assemblies, you will need to define your own custom interface to call and reference the assembly since you can't cast to a class in the other assembly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2012 14:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678234#M18163</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2012-10-29T14:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Combobox Selected Item</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678235#M18164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What about grouping your button and combobox into an application extension?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the initialization method of the extension, you could get instances of both types of add-ins for use later.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2012 16:31:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678235#M18164</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2012-10-29T16:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: Combobox Selected Item</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678236#M18165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your button is a straight Command, you could have multiple instances of it.&amp;nbsp; So maintaining a reference to the command on an extension would not work.&amp;nbsp; The extension will always be a unique instance (by definition), so you can keep a reference to the extension on your two controls and use it to pass values back and forth (this is a model I use a lot.)&amp;nbsp; You can also place a button on your toolcontrol along side of your combobox, that works nicely some times.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2012 17:05:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/combobox-selected-item/m-p/678236#M18165</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2012-10-29T17:05:34Z</dc:date>
    </item>
  </channel>
</rss>

