VB 谁能帮我写个简单小程序啊,自己写了好长时间也不行

来源:百度知道 编辑:UC知道 时间:2024/06/04 09:38:45
设两个按钮,记录单击次数~~

第二个单击高录次数的条件为,如果当第两个按钮点总击次数为3且按钮1点击次数为1次时按钮2才能显示1.
如果当第两个按钮点总击次数为2且按钮1点击次数为2次时按钮2才能显示2.

Option Explicit
Dim i As Integer
Dim j As Integer

Private Sub Command1_Click()
i = i + 1
Call check
End Sub

Private Sub Command2_Click()
j = j + 1
Call check
End Sub
Sub check()
If i + j = 3 And i = 1 Then
Command2.Caption = "1"
End If
If i + j = 2 And i = 2 Then
Command2.Caption = "2"
End If
End Sub

这有什么难的啊,设置变量,单击一次按钮就加1啊,然后用IF语句判断