以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=103406)

--  作者:minxizai
--  发布时间:2017/7/7 10:50:00
--  [求助]
窗口中有8个文本框,名称分别为1-8
在按钮click事件中,下面代码为什么不执行?
Dim s1() As String = {"1","2","3","4","5","6","7","8"}
For i As Integer = 0 To 7
e.Form.Controls("s1(i)").Value = Nothing
Next

--  作者:有点甜
--  发布时间:2017/7/7 10:52:00
--  

For i As Integer = 1 to 8
    e.Form.Controls(i).Value = Nothing
Next

 

或者

 

Dim s1() As String = {"1","2","3","4","5","6","7","8"}
For Each s As String In s1
    e.Form.Controls(s).Value = Nothing
Next

[此贴子已经被作者于2017/7/7 10:52:05编辑过]

--  作者:minxizai
--  发布时间:2017/7/7 11:19:00
--  
谢谢