Try this:
List<Type> types = new List<Type>() { typeof(Button), typeof(TextBox) };
The typeof()
operator is used to return the System.Type
of a type.
For object instances you can call the GetType()
method inherited from Object.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…