using System; using System.Collections.Generic; using System.Text; using System.IO; namespace ComboBoxTest { public class Combo1 : ESRI.ArcGIS.Desktop.AddIns.ComboBox { private bool m_updating; public Combo1() { m_updating = true; int firstCookie = Add("Items"); Select(firstCookie); for (int i = 1; i < 11; i++) { Add(i.ToString()); } m_updating = false; } protected override void OnUpdate() { Enabled = ArcMap.Application != null; } protected override void OnSelChange(int cookie) { if (m_updating == false) { // Added reference to System.Windows.Forms System.Windows.Forms.MessageBox.Show(Value); } base.OnSelChange(cookie); } } }
I am experiencing the same symptom. Did you ever find a resolution to this?
string myvalue; protected override void OnSelChange(int cookie) { myvalue = this.Value.ToString(); doSomethingMethod(myvalue); } void doSomethingMethod(string txt) { MessageBox.Show(txt) }
string myvalue; protected override void OnSelChange(int cookie) { myvalue = this.Value.ToString(); if (myvalue != "") doSomethingMethod(myvalue); } void doSomethingMethod(string txt) { MessageBox.Show(txt) }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.