public enum Packers { Aaron_Rodgers = 12, Eddie_Lacy = 26, Jordy_Nelson = 87, Candle_Robb = 18, Clay_Matthews = 52, Julius_Peppers = 56 }; private void button4253147968_Click(object sender, EventArgs e) { int packerNum = Convert.ToInt32(textBoxPackerNum.Text); String packerName = Enum.GetName(typeof(Packers), packerNum); MessageBox.Show(String.Format("Packer with number {0} is {1}", packerNum, packerName)); }
int x = 52; Console.WriteLine(((Packers)x).ToString());
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)