以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [讨论]代码执行错误  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=41019)

--  作者:wsxdwh
--  发布时间:2013/10/9 13:30:00
--  [讨论]代码执行错误
Dim a As Integer = 0
Dim ns As List (of  String)
For Each c As Winform.Control In e.Form.Controls
    If Typeof c Is WinForm.CheckBox Then
        Dim chk As WinForm.CheckBox = c
        If  chk.Checked = True  Then
            a = a + 1           
            ns.Add(""& chk.text &"")           
        End  If
    End  If
Next
MessageBox.Show(a)
For Each  n As String In ns
    MessageBox.Show(n)
Next


红色代码执行时有问题   请指教!!!

--  作者:wsxdwh
--  发布时间:2013/10/9 13:33:00
--  
图片点击可在新窗口打开查看

--  作者:wsxdwh
--  发布时间:2013/10/9 13:36:00
--  
错误提示
--  作者:wsxdwh
--  发布时间:2013/10/9 13:37:00
--  
错误提示

--  作者:wsxdwh
--  发布时间:2013/10/9 13:58:00
--  
Dim a As Integer = 0
Dim ns As New List (of  String)
For Each c As Winform.Control In e.Form.Controls
    If Typeof c Is WinForm.CheckBox Then
        Dim chk As WinForm.CheckBox = c
        If  chk.Checked = True  Then
            a = a + 1
            Dim str  As  String = chk.text
            ns. Add (str)
        End  If
    End  If
Next
For Each  n As String In ns
    MessageBox.Show(n)
Next
改好了