The Vision’s Wizards

June 28, 2008

Rtf

Filed under: Uncategorized — thevisionswizards @ 1:37 am

Using strings and enum - C# .NET

private enum cartypes

{ Lotus = 0, Morgan = 1, Atom = 2 }

private void button1_Click(object sender, EventArgs e) { CarTypes myCarType = CarTypes.Morgan; textBox1.Text = Enum.GetName(typeof(CarTypes), myCarType) + “, ” + myCarType.ToString() + “, ” + (myCarType==CarTypes.Morgan).ToString();myCarType = (CarTypes)Enum.Parse(typeof(CarTypes), “Atom”); textBox1.Text += “\r\n” + Enum.GetName(typeof(CarTypes), myCarType) + “, ” + myCarType.ToString() + “, ” + (myCarType == CarTypes.Atom).ToString();myCarType = (CarTypes)Enum.Parse(typeof(CarTypes), “loTus”, true); textBox1.Text += “\r\n” + Enum.GetName(typeof(CarTypes), myCarType) + “, ” + myCarType.ToString() + “, ” + (myCarType == CarTypes.Lotus).ToString(); }


Lancaster county pa

I have collected this from internet


Related posts: Guitar hero 4, Gypsy musical, Williams, Style of man, Catherines

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress