Hello,
I'm pretty new to C# and .NET. I have been working with the arrays within comboBoxes
I have created a method to add multiple comboBoxes, each with defined items to select from (1,2,3,4,5,6,7,8,9,10)
When I run the program, comboboxes get created automatically. When I select the value from a combobox I want to store that selected value as 'double' and then I want to reuse that stored value outside of the method within a new button. Here is my code for the method: Any input is appreciated
private int AddCreditHoursComboBox(int count, ComboBox[] creditHours, int z, int m)
{
for (int i = 0; i < count; i++)
{
creditHours[i] = new ComboBox();
creditHours[i].Items.Add("1");
creditHours[i].Items.Add("2");
creditHours[i].Items.Add("3");
creditHours[i].Items.Add("4");
creditHours[i].Items.Add("5");
creditHours[i].Items.Add("6");
creditHours[i].Items.Add("7");
creditHours[i].Items.Add("8");
creditHours[i].Items.Add("9");
creditHours[i].Items.Add("10");
creditHours[i].Location = new System.Drawing.Point(z, m);
creditHours[i].Size = new Size(80, 70);
creditHours[i].TabIndex = 1;
this.Controls.Add(creditHours[i]);
this.ResumeLayout(false);
m += 40;
}
return m;