foreach(Control c in this.Controls)
{
   
}

解决方案 »

  1.   

    Type.GetProperty(PropertyName).GetValue()
      

  2.   

    如楼上
    c.GetType().GetProperty(PropertyName).SetValue
      

  3.   

    若要使用 GetValue 方法,请先获取类 Type。从 Type 获取 PropertyInfo。从 PropertyInfo,使用 GetValue 方法。
    Type t = Type.GetType(className,true,true);
    t = Assembly.GetAssembly(t).GetType(className);
    object obj = Activator.CreateInstance(t);
    t.GetProperty(PropertyName).GetValue(obj,null);