以下为某按钮的CLICK事件代码:
Dim RedBlueBall() As Integer = { 01,02,07,08,12,13,18,19,23,24,29,30,34,35,40,45,46,03,04,09,10,14,15,20,25,26,31,36,37,41,42,47,48 }
Dim BlueGreenBall() As Integer = { 03,04,09,10,14,15,20,25,26,31,36,37,41,42,47,48,05,06,11,16,17,21,22,27,28,32,33,38,39,43,44,49 }
Dim RedGreenBall() As Integer = { 01,02,07,08,12,13,18,19,23,24,29,30,34,35,40,45,46,05,06,11,16,17,21,22,27,28,32,33,38,39,43,44,49 }
Dim BallColor As String = e.Form.Controls("ComboBox1").Value
Dim HeadNum() As String = e.Form.Controls("TextBox2").Text.Split(".")
Dim head1 As Integer = CInt(HeadNum(0))
Dim head2 As Integer = CInt(HeadNum(1))
Dim head3 As Integer = CInt(HeadNum(2))
Dim FilterResult() As Integer
Dim i As Integer = 0
Dim j As Integer = 0
'以上代码执行没有出错
For i = 0 To RedBlueBall.length-1
If RedBlueBall(i) >= (head1* 10) And RedBlueBall(i)< (( head1+1)*10)
FilterResult(j) = RedBlueBall(i) '程序进入此行出错----“未将对象引用设置到对象的实例。”
j = j+1
Else If RedBlueBall(i) >= (head2*10) And RedBlueBall(i)< ((head2+1)*10)
FilterResult(j) = RedBlueBall(i)
j = j+1
Else If RedBlueBall(i) >= (head3*10) And RedBlueBall(i)< ((head3+1)*10)
FilterResult(j) = RedBlueBall(i)
j = j+1
End If
Next
=================求指点=
[此贴子已经被作者于2015/11/14 22:42:58编辑过]