根据名称查找控件
TextBox NameStrTextBox(string str)
{
string name = str;
object o = this.GetType().GetField(name, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this);
return ((TextBox)o);
}
根据控件返回控件名称字符串
string GetButtonNameStr(object obj)
{
System.Windows.Forms.Button btn = (System.Windows.Forms.Button)obj;
return btn.Name;
}
调用方法
略
特此记录
anlog
2024年12月19日
2572

被折叠的 条评论
为什么被折叠?



