这道题VB程序设计怎么做?
1个回答
展开全部
Option Explicit
Private Sub Command1_Click()
Text1.Text = ""
Label2.Caption = ""
Dim sum As Integer
Dim i As Integer
For i = 0 To 9
If List1.List(i) Mod 2 = 0 Then
If Text1.Text = "" Then
Text1.Text = List1.List(i)
Else
Text1.Text = Text1.Text & " " & List1.List(i)
End If
sum = sum + Val(List1.List(i))
End If
Next i
Label2.Caption = sum
End Sub
Private Sub Form_Load()
Text1.Text = ""
Label2.Caption = ""
List1.Clear
Dim i As Integer
For i = 0 To 9
Randomize
List1.AddItem Int(Rnd * (99 - 10 + 1)) + 10, i
Next i
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询