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); } } }
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) }
I am experiencing the same symptom. Did you ever find a resolution to this?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.