in

DevPinoy.org

A Filipino Developers Community
ATTENTION:Take our Code Challenge for the month of October 2008 and win some great prize! Learn more about it here!
Latest post 08-12-2008 2:35 PM by arhabrenica. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-12-2008 11:02 AM

    Capture combobox.SelectedIndexChanged object value in C#

    Hi, I am new in C# and learning. Can you please help me capture the object save in combobox.

    I populated the comboxbox using this class

     public class ItemValue
     {
            private string m_Display;
            private long m_Value;
            public ItemValue(string Display, long Value)
            {
                m_Display = Display;
                m_Value = Value;
            }
            public string Display
            {
                get{return m_Display;}
            }
            public long Value
            {
                get{return m_Value;}
            }
     }

    now in SelectedIndexChanged, how would I get capture the selected value/display?

    private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)

     

    Maraming salamat po!

    • Post Points: 5
  • 08-12-2008 2:35 PM In reply to

    Re: Capture combobox.SelectedIndexChanged object value in C#

     long selectedValue = ([Class Name])comboBox1.SelectedItem).Value

    maraming salamat...

    • Post Points: 5
Page 1 of 1 (2 items)

Copyright DevPinoy 2005-2008
Powered by Community Server (Commercial Edition), by Telligent Systems