I have a list
List<Control> inputBoxes = new List<Control>();
where I have added comboboxes and textboxes.
I can set the text property with inputBoxes[0].GetType().GetProperty("Text").SetValue(inputBoxes[0], "ABC", null);
but how can I add items to the comboboxes and select them?
Can I use inputBoxes[0].GetType().GetMethod() somehow?
Why do you use reflection to simply set a property?
You can use this which is much more efficient and less error-prone:
If you want to add items to one (or multiple) ComboBoxes:
Note that you need to add
using System.LinqforOfType