C# 通过了解typeName和contorl名称获取控件属性

C# 通过了解typeName和contorl名称获取控件属性,c#,controls,C#,Controls,我必须通过了解控件的类型和名称来访问某些控件属性: 例如: Type myType1 = Type.GetType("System.Windows.Forms.Button"); var ctrl_Prop = this.Controls.OfType<>().Where(r => r.Name == "myButton"); typemytype1=Type.GetType(“System.Windows.Forms.Button”

我必须通过了解控件的类型和名称来访问某些控件属性:

例如:

Type myType1 = Type.GetType("System.Windows.Forms.Button");

var ctrl_Prop = this.Controls.OfType<>().Where(r => r.Name == "myButton");
typemytype1=Type.GetType(“System.Windows.Forms.Button”);
var ctrl_Prop=this.Controls.OfType()。其中(r=>r.Name==“myButton”);
问题是如何在这里传递
this.Controls.OfType
控件类型?

请查看:
this.Controls.OfType()…
this.Controls.OfType()。其中(r=>r.Name==“myButton”)<代码>名称
属于公共基类。当然,它不包括组件(因此您找不到工具提示)。