C#:通过字符串(文本)调用控件

TextBox tb = (TextBox)this.GetType().GetField("tb_Runtime", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this);

tb.Text="SUCCESS";

//通过字符串调用名字为"tb_Runtime"的TexbBox

猜你喜欢

转载自blog.csdn.net/jyh_jack/article/details/81181846
今日推荐