看板 C_Sharp 關於我們 聯絡資訊
※ 引述《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
sheauren:如果沒其他欄位 乾脆redirect自己這個page就好 140.125.251.33 07/14
kenliao:<input type="reset"> 不就好了@@" 220.134.23.117 07/14
Eric30:推樓上 @@ 140.113.138.30 07/14