Created
April 15, 2012 23:44
-
-
Save tcsavage/2395366 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
comboBox1.DataSource = Enum.GetValues(typeof(MyEnum)); | |
} | |
private void comboBox1_SelectedValueChanged(object sender, EventArgs e) | |
{ | |
MyEnum value = (MyEnum)(((ComboBox)sender).SelectedItem); | |
label1.Text = value.ToString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment