I have a List of Components
List<Component> components = new List<Component>();
I am designing a dynamic forms framework. I know that casting to a specific component is impossible even if I know what kind of component each of them is. How can I get the component as a specific type (for example
ComboBox) in order to use their properties.
For example I know that the first item of
components is a
Can I get it as
ComboBox in order to use it?
Filters the elements of an IEnumerable based on a specified type.
var textBoxes = components.OfType<TextBox>();