MyITBlog.com - IT Professionals Online Journal
 
  Home  |   Site News  |   About Us  |   Privacy  |   FAQ  |   Contact   Add Blog Entry  |  Login  |  Register   
 My Account
Username
Password
Remember me
Lost Password?


 Categories


  HOME  >  ProgrammingPrint


0
Votes
All about Enum and sample code snippet for binding enum to a combo box in Programming   
by praveen on 15 Nov 2005, 05:26     Read praveen's Blog
Total Hits: 613    Comments: 0   

An Enum is a structure extending ValueType and not a Class. It not explicitly created on the heap memory.

Instead, it is a field within a Class and exist temporarily on the stack as a local variable. The cost of an Enum is typically 4 bytes. This is due to 32-bit word alignment.

 

Code Snippet to bind enum to a combo box

 

string[] enumString= Enum.GetNames(typeof(MyEnum));

 

foreach(string s in enumString)

{

comboBox1.Items.Add(s);

}

 

 

 

Happy coding !

:)

Praveen


 

Post Comment

Copyright © 2008 MyITBlog.com