以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  清除窗口  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=72328)

--  作者:woshiabc
--  发布时间:2015/7/28 13:49:00
--  清除窗口
请问清除窗口内容,进行下一次编辑代码怎样写?
--  作者:大红袍
--  发布时间:2015/7/28 14:05:00
--  

 e.Form.Controls("Textbox1").Text = Nothing

 e.Form.Controls("Textbox2").Text = Nothing


--  作者:woshiabc
--  发布时间:2015/7/28 14:26:00
--  
清除所有内容只能一个个清吗,假如窗口有20个text岂不是很麻烦
--  作者:有点蓝
--  发布时间:2015/7/28 14:41:00
--  
For Each c As WinForm.Control In e.Form.Controls
    If
 Typeof c Is WinForm.TextBox Then \'判断控件是否是文本框
        
Dim t As WinForm.TextBox = c \'使用特定类型的变量引用控件
        t.Value = 
Nothing
    End
 If
Next