WinForm
foreach (Control control in this.Controls) {
if (control is TextBox) {
(control as TextBox).Text = "Hello World.";
}
}
ASP.NET
foreach (Control control in this.FindControl("form1").Controls) {
if (control is TextBox) {
(control as TextBox).Text = "Hello world.";
}
}
posted on 2008-09-11 10:24
Alan Cai 阅读(99)
评论(0) 编辑 收藏