List<string> list = new List<string>();
            list.Add("textBox2"); list.Add("textBox1"); list.Add("txtNum");

            StringBuilder sb = new StringBuilder();
 
            foreach (Control ctl in this.Controls)
            {
                if (ctl is TextBox)
                {
                    //txtNum
                    var obj = ctl.Name;
                    sb.AppendFormat("list.Add(\"{0}\");",obj);
                }
            }
           var name =  sb.ToString();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
相关资源
相似解决方案