e.Form.Controls("Label5").Visible =True
e.Form.Controls("Label6").Visible =True
e.Form.Controls("Label7").Visible =True
e.Form.Controls("Label8").Visible =True
e.Form.Controls("TextBox1").Visible =True
e.Form.Controls("TextBox2").Visible =True
e.Form.Controls("TextBox3").Visible =True
e.Form.Controls("TextBox4").Visible =True
老师看看这段代码能简化么?
下面这样写可以么,还有好点的么
Dim T As String() = {"Label5","Label6","Label7","Label8","TextBox1","TextBox2","TextBox3","TextBox4"}
For n As Integer = 0 To 7
e.Form.Controls(T(n)).Visible = True
Next
[此贴子已经被作者于2015-1-7 18:14:50编辑过]