一道VB考试的上机题目

来源:百度知道 编辑:UC知道 时间:2024/05/10 10:18:09
Private Sub Command1_Click()
Dim n As Long
Dim j As Integer, k As Integer
For i = 1 To 5000
If i Mod Combo1.List(ListCount) = 0 Then
k = i Mod Combo1.List(ListCount)
n = k + n
End If
Text1 = n
Next i
End Sub

我上机的时候查看了MSDN,然后做出来虽然显示的不是0,但后来一想错了
我上机的时候忘记用了If判断!!现在忘记怎么样做了。。

Combo1.List(ListCount)是这里错吗?那格式是什么我忘记了///
建有一个ComboBox,Command,text
可是运行的时候text显示为0
ComboBox的List有三个数 3.0 7.0 11

Private Sub Command1_Click()
Dim n As Long
Dim j As Integer, k As Integer
For i = 1 To 5000
If i Mod Combo1.ListCount = 0 Then
k = i Mod Combo1.ListCount
n = k + n
End If
Next i
Text1.text= n
End Sub
按你原程序中错误改的。