I. This is the part of the code in the C# form
this.cbDay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbDay.FormattingEnabled = true;
this.cbDay.Items.AddRange(new object[] {
});//items from a loop in another class and method.
II. This is my method in another class
namespace StudentRegistrationApplication
public class loopComboBoxSelection
{
public loopComboBox(int start, int finsh)
{
for (int i = start; i < finsh; i++)
{
ComboboxItem item = new ComboboxItem();
item.Text = "Item " + i;
item.Value = i;
ModDown.Items.Add(item);
}
}
}
III. I want to call the loop method that will generate items from 1 to 100. For this question, what is the syntax?
this.cbDay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbDay.FormattingEnabled = true;
this.cbDay.Items.AddRange(new object[] {
"1"
"2"
"3"
"4"
"5"});