This commit is contained in:
2023-10-13 00:20:08 +08:00
parent f329cbf00c
commit a9ccc7ceea
4 changed files with 346 additions and 14 deletions

118
Form1.frm
View File

@@ -9,47 +9,55 @@ Begin VB.Form Form1
ScaleHeight = 4365
ScaleWidth = 8565
StartUpPosition = 3 '<27><><EFBFBD><EFBFBD>ȱʡ
Begin VB.TextBox Text3
Height = 375
Begin VB.CommandButton reset
Caption = "<22><><EFBFBD><EFBFBD>"
Height = 615
Left = 4440
TabIndex = 8
Top = 2280
Width = 1575
End
Begin VB.TextBox result_text
Height = 495
Left = 4920
TabIndex = 7
Text = "Text3"
Top = 720
Top = 600
Width = 855
End
Begin VB.TextBox Text2
Begin VB.TextBox num2
Enabled = 0 'False
Height = 495
Left = 2640
TabIndex = 4
Text = "Text2"
Top = 600
Width = 855
End
Begin VB.TextBox Text1
Begin VB.TextBox num1
Enabled = 0 'False
Height = 495
Left = 840
TabIndex = 3
Text = "Text1"
Top = 600
Width = 855
End
Begin VB.CommandButton Command3
Begin VB.CommandButton quit
Caption = "<22>˳<EFBFBD>(&Q)"
Height = 615
Left = 6120
Left = 6360
TabIndex = 2
Top = 2280
Width = 1575
End
Begin VB.CommandButton Command2
Begin VB.CommandButton checkout
Caption = "<22><><EFBFBD><EFBFBD>"
Enabled = 0 'False
Height = 615
Left = 3360
Left = 2520
TabIndex = 1
Top = 2280
Width = 1575
End
Begin VB.CommandButton Command1
Begin VB.CommandButton question
Caption = "<22><><EFBFBD><EFBFBD>"
Height = 615
Left = 600
@@ -57,10 +65,50 @@ Begin VB.Form Form1
Top = 2280
Width = 1575
End
Begin VB.Label times
Caption = "0"
Height = 375
Left = 6960
TabIndex = 12
Top = 720
Width = 1215
End
Begin VB.Label times_label
Caption = "<22><><EFBFBD><EFBFBD>:"
Height = 375
Left = 6360
TabIndex = 11
Top = 720
Width = 495
End
Begin VB.Label result
Height = 375
Left = 6960
TabIndex = 10
Top = 360
Width = 975
End
Begin VB.Label result_label
Caption = "<22><><EFBFBD><EFBFBD>:"
Height = 255
Left = 6360
TabIndex = 9
Top = 360
Width = 495
End
Begin VB.Label Label2
Caption = "="
BeginProperty Font
Name = "<22><><EFBFBD><EFBFBD>"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3840
Left = 4080
TabIndex = 6
Top = 720
Width = 495
@@ -88,3 +136,45 @@ Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub checkout_Click()
num1_result = Val(num1.Text)
num2_result = Val(num2.Text)
number_result = num1_result + num2_result
input_result = Val(result_text.Text)
If number_result = input_result Then
result.Caption = "<22><>ȷ"
num1.Text = Int((Rnd * 100) + 1)
num2.Text = Int((Rnd * 100) + 1)
question.Enabled = True
result_label.Caption = ""
checkout.Enabled = False
Else
result.Caption = "<22><><EFBFBD><EFBFBD>"
End If
times = times + 1
End Sub
Private Sub Form_Load()
Randomize
Dim times As Integer
End Sub
Private Sub question_Click()
num1.Text = Int((Rnd * 100) + 1)
num2.Text = Int((Rnd * 100) + 1)
checkout.Enabled = True
question.Enabled = False
End Sub
Private Sub quit_Click()
End
End Sub
Private Sub reset_Click()
num1.Text = ""
num2.Text = ""
result_text.Text = ""
result.Caption = ""
times = 0
question.Enabled = True
End Sub