After Triggering an event, I want to add some more item to the ComboBox in my WinForm.
The following is my sample code, which is not neat at all, also I violated DRY(don't repeat yourself) principle. I am a newbie seeking for a neat code. Please help me out.
Combobox1.Items.Add("aaa")
Combobox2.Items.Add("aaa")
....
Combobox50.Items.Add("aaa")
As you can see, I can do this if there are only 5 to 10 items needed to be added to the Combobox. What if there are 50 of them ? And I want to select certain combobox to add item to it.
I wana find a better way to do this, don't repeat the above routine for too much time. Please help me with a neater code. Thanks!!!