日期:2014-05-18 浏览次数:20794 次
Control[] ctrls = Controls.Find(textBox1.Text, true); if (ctrls.Length > 0) { Control ctrl = ctrls[0]; PropertyInfo pi = ctrl.GetType().GetProperty(textBox2.Text); object val = pi.GetValue(ctrl, null); if (val != null) MessageBox.Show(val.ToString()); }