I would like to load the items that were declared in class file when the Form loads can any one give me an idea
My class file code is as follows
namespace ACHDAL
{
public class TansactionCode
{
string[] strTransactionCodes ={"20","21","22","23","24","25","26","27","28","29","30","31","32","33","34",
"35","36","37","38","39","41","42","43","44","46","47","48","49","51","52","53","54","55","56","80",
"81","82","83","84","85","86"};
}
}
Would like to load all these in to the combo box when the Form loads if any thing has to be done in this code please let me know.
You populate combo boxes by setting their DataSource property (see here for more details on what you can bind to them).
To do this you’ll need to expose the list first, so put it into a property. This is how the form will access it, after creating a new instance of the class.
Then do this on the FormLoad event
eg