DevPinoy.org
A Filipino Developers Community

>>> First two to make 3 wins! <<<

Capture combobox.SelectedIndexChanged object value in C#

rated by 0 users
This post has 1 Reply | 1 Follower

Top 500 Contributor
Posts 2
Points 10
arhabrenica Posted: 08-12-2008 11:02 AM

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
Top 500 Contributor
Posts 2
Points 10

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

maraming salamat...

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

Copyright DevPinoy 2005-2008