This works fine for me (I've added a
ComboBox
called
cbCurrencies on the form in design mode):
public partial class Form1 : Form
{
public enum Currency
{
INR = 0,
USD = 4545,
JPY = 2152,
EUR = 5241
}
public Form1()
{
InitializeComponent();
cbCurrencies.DataSource = System.Enum.GetValues(typeof(Currency));
}
private void cbCurrencies_SelectedIndexChanged(object sender, EventArgs e)
{
Currency cur = (Currency)cbCurrencies.SelectedValue;
int value = (int)cur;
}
}
:)