在窗口中,可以用数组给复选框赋值吗?比如这样的代码
Dim a1 As WinForm.CheckBox = e.Form.Controls("CheckBox1")
Dim a2 As WinForm.CheckBox = e.Form.Controls("CheckBox2")
Dim a3 As WinForm.CheckBox = e.Form.Controls("CheckBox3")
Dim vs() As String = {"Y","N","N"}
Dim ks() As Boolean = {a1.Checked,a2.Checked,a3.Checked}
For l As Byte = 0 To 2
If vs(l) = "Y" Then
ks(l) = True
End If
Next
但是好像又行不通,用这样的方式,复选框没有任何变化,老师有其他建议吗?
已经搞定了,是Dim ks() As Boolean = {a1.Checked,a2.Checked,a3.Checked}错了
[此贴子已经被作者于2017/9/19 14:20:20编辑过]