时间:2021-07-01 10:21:17 帮助过:6人阅读
/// <summary>
/// 根据控件id得到控件
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
private Control GetControl(string name)
{
object o = this.GetType().GetField(name, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this);
return ((Control)o);
}
这个方法就能很快的找到该控件