vb编写程序实现两个列表框数的加减乘除
2015-05-21
展开全部
Private Sub Command1_Click()
Dim i As Integer
List3.Clear
For i = 0 To List1.ListCount - 1
List3.AddItem List1.List(i) + List2.List(i)
Next
End Sub
Private Sub Command2_Click()
Dim i As Integer
List3.Clear
For i = 0 To List1.ListCount - 1
List3.AddItem List1.List(i) - List2.List(i)
Next
End Sub
Private Sub Command3_Click()
Dim i As Integer
List3.Clear
For i = 0 To List1.ListCount - 1
List3.AddItem List1.List(i) * List2.List(i)
Next
End Sub
Private Sub Command4_Click()
Dim i As Integer
List3.Clear
For i = 0 To List1.ListCount - 1
List3.AddItem List1.List(i) / List2.List(i)
Next
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 10
List1.AddItem i
Next i
For i = 11 To 20
List2.AddItem i
Next i
Command1.Caption = "加"
Command2.Caption = "减"
Command3.Caption = "乘"
Command4.Caption = "除"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询