日期:2014-05-19  浏览次数:20621 次

WinForm 中通过反射怎样才可以得到窗体界面中的某一控件的属性值?
问题一
        WinForm   中通过反射怎样才可以得到窗体界面中的某一控件的属性值?

问题二
        自定义特性(AttributeUsage)可以传递   复杂对象吗?如   DataSet   等

------解决方案--------------------
你试着做就是了,比如:
Type type = typeof(Button);
PropertyInfo info = type.GetProperty( "Name ");
object value = info.GetValue(this.button1, null);

------解决方案--------------------
我顶,同志们加把劲哎
------解决方案--------------------
帮你顶,顺便学习
------解决方案--------------------
反射能这样反么?学习