WinFrom动态获取/设置控件的属性

  • A+
所属分类:ASP.NET C#

WinFrom动态获取/设置控件的属性

直接贴代码备查

  1. Control[] ctrs = this.Controls.Find("txtPhotoName" i.ToString(), true);  
  2. if (ctrs.Length > 0) ((TextBox)ctrs[0]).Text = "Name:" ctrs[0].Name;  
  1. 参考链接:http://www.csframework.com/archive/2/arc-2-20110326-1241.htm  
钰玺

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: