Skip to content

Instantly share code, notes, and snippets.

@tcsavage
Created April 15, 2012 23:44
Show Gist options
  • Save tcsavage/2395366 to your computer and use it in GitHub Desktop.
Save tcsavage/2395366 to your computer and use it in GitHub Desktop.
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