<?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 Re: What is the best way to implement MRU combo box? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303718#M7904</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could call Remove or RemoveAt to remove the item from the list then call Insert to add it back at the desired index position.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2013 14:44:43 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2013-01-24T14:44:43Z</dc:date>
    <item>
      <title>What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303717#M7903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to implement a combobox which manages its collection of items as a most recently used (MRU) list. I need to be able to move an item to the top of the list if it is selected, but I've only found the Add() method which appends to the end of the list. Of course, I can clear the combobox and add the reordered list, but that just seems kludgey to me. Any suggestions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 14:18:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303717#M7903</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-01-24T14:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303718#M7904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could call Remove or RemoveAt to remove the item from the list then call Insert to add it back at the desired index position.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 14:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303718#M7904</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-24T14:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303719#M7905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could call Remove or RemoveAt to remove the item from the list then call Insert to add it back at the desired index position.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, that is how I would prefer to do it, but I don't see any of those methods on the ArcGIS interfaces:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IComboBox_Interface/00430000000t000000/"&gt;IComboBox&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00430000000v000000"&gt;IComboBoxHook&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I be casting to another interface that has those methods?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 15:13:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303719#M7905</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-01-24T15:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303720#M7906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The docs indicate you should be subclassing this if you want to use it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/java_ao_adf/api/arcobjects/com/esri/arcgis/addins/desktop/ComboBox.html"&gt;http://help.arcgis.com/en/sdk/10.0/java_ao_adf/api/arcobjects/com/esri/arcgis/addins/desktop/ComboBox.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.NET docs say:&amp;nbsp; &lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Use this interface to define a custom combo box.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why not use a .NET combobox?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 15:36:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303720#M7906</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-01-24T15:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303721#M7907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oh, you're talking about an addin.&amp;nbsp; I don't think there's any way but to clear the list and add the items back like you said.&amp;nbsp; As far as I know, the underlying combobox control isn't exposed.&amp;nbsp; If you were implementing the old style command/toolcontrol then you could expose the underlying combobox and get access to all of its properties and methods.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 15:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303721#M7907</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-01-24T15:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303722#M7908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry, didn't know you were talking about addins either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You saw this?&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000004nw000000.htm"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/0001/0001000004nw000000.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 15:54:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303722#M7908</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-01-24T15:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303723#M7909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There's also this &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ComboBox_Class/001v00000173000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;topic&lt;/A&gt;&lt;SPAN&gt; specifically about the Addin combobox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That topic also contains C# and VB.Net code on implementation&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Public Class Combo1
&amp;nbsp; Inherits ESRI.ArcGIS.Desktop.AddIns.ComboBox
&amp;nbsp; Public Sub New()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add two items to the combo box.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim o1 As New Point()
&amp;nbsp;&amp;nbsp;&amp;nbsp; o1.PutCoords(0, 0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim c1 As Integer = Me.Add("Item1", o1)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim o2 As New Point()
&amp;nbsp;&amp;nbsp;&amp;nbsp; o2.PutCoords(1, 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim c2 As Integer = Me.Add("Item2", o2)

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add the application's caption.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim app As ESRI.ArcGIS.Framework.IApplication = TryCast(Me.Hook, ESRI.ArcGIS.Framework.IApplication)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Add(app.Caption)

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Add one item then remove
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim c3 AsInteger = Me.Add("Item3")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Remove(c3)

&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Select the second item.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.[Select](c2)
&amp;nbsp; End Sub
&amp;nbsp; 
&amp;nbsp; Protected Overloads Overrides Sub OnSelChange(ByVal cookie AsInteger)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If cookie = -1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Get the associated object.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim tag As Point = TryCast(Me.GetItem(cookie).Tag, Point)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If tag IsNot Nothing Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.MessageBox.Show((tag.X &amp;amp; ", ") + tag.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; End Sub
&amp;nbsp; 
&amp;nbsp; Protected Overloads Overrides Sub OnEnter()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Loop through the item collection.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fo rEach item As ESRI.ArcGIS.Desktop.AddIns.ComboBox.Item In Me.items
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Me.Value = item.Caption Then 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Add(Me.Value)
&amp;nbsp; End Sub
&amp;nbsp; 
&amp;nbsp; Protected Overloads Overrides Sub OnEditChange(ByVal editString AsString)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If String.Compare(editString, "ABC", True) = 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.MessageBox.Show("editString is " &amp;amp; Me.Value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; End Sub
&amp;nbsp; 
&amp;nbsp; Protected Overloads Overrides Sub OnFocus(ByVal [set] AsBoolean)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If [set] Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Diagnostics.Debug.WriteLine("Get focus.")
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not [set] Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Diagnostics.Debug.WriteLine("Lose focus.")
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; End Sub
&amp;nbsp; 
&amp;nbsp; Protected Overloads Overrides Sub OnUpdate()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Enabled = ArcMap.Application Is Not Nothing
&amp;nbsp; End Sub
End Class


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:33:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303723#M7909</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T14:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to implement MRU combo box?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303724#M7910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, all. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate the links--they confirm what I had found. It looks like the consensus is that I'll have clear and re-add the list if I want to reorder it. Bummer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 17:26:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-is-the-best-way-to-implement-mru-combo-box/m-p/303724#M7910</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2013-01-24T17:26:57Z</dc:date>
    </item>
  </channel>
</rss>

