作者Eric30 (eric)
看板C_Sharp
标题Re: textbox的内容
时间Thu Jul 14 14:27:20 2005
※ 引述《snaiko ()》之铭言:
: 我写网页...希望做一个按钮按下去可以清除所有textbox的资料....
: 要怎麽写??不要用丢空字串的方法.....
foreach(Control c in this.Controls)
{
if(c.GetType().ToString().Equals("System.Windows.Forms.TextBox"))
{
c.Text = "";
}
}
要清空一个TextBox , 不丢空字串要怎麽办? @@a
还是您的意思是 , 不要一个一个TextBox丢空字串 @@~?
就是不要
this.TextBox1.Text = "";
this.TextBox2.Text = "";
...... etc ~
是这样吗 Orz
--
有更好的方法请务必指正喔:)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.96.116.160
1F:推 sheauren:如果没其他栏位 乾脆redirect自己这个page就好 140.125.251.33 07/14
2F:推 kenliao:<input type="reset"> 不就好了@@" 220.134.23.117 07/14
3F:推 Eric30:推楼上 @@ 140.113.138.30 07/14