Populate combobox using array

Bubbly
Posted by Bubbly under C# category on | Views : 4720
Bind combo box to a simple array of string entries for colors.


private void cmdArray_Click(object sender, System.EventArgs e) 
{

string[] myColors = {"AQUA","BLACK","BLUE","GREEN","RED","WHITE","YELLOW"};

ComboBox1.DataSource=myColors;

ComboBox1.SelectedIndex=0;

GroupBox1.Visible=false;

lblSource.Text="Array";

}

Comments or Responses

Login to post response