This repository has been archived on 2025-12-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Math-VB/Form1.frm

181 lines
4.7 KiB
Plaintext
Raw Normal View History

2023-10-12 23:53:19 +08:00
VERSION 5.00
Begin VB.Form Form1
2023-10-13 00:22:43 +08:00
Caption = "Math-VB"
2023-10-12 23:53:19 +08:00
ClientHeight = 4365
ClientLeft = 120
ClientTop = 465
ClientWidth = 8565
LinkTopic = "Form1"
ScaleHeight = 4365
ScaleWidth = 8565
StartUpPosition = 3 '<27><><EFBFBD><EFBFBD>ȱʡ
2023-10-13 00:20:08 +08:00
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
2023-10-12 23:53:19 +08:00
Left = 4920
TabIndex = 7
2023-10-13 00:20:08 +08:00
Top = 600
2023-10-12 23:53:19 +08:00
Width = 855
End
2023-10-13 00:20:08 +08:00
Begin VB.TextBox num2
Enabled = 0 'False
2023-10-12 23:53:19 +08:00
Height = 495
Left = 2640
TabIndex = 4
Top = 600
Width = 855
End
2023-10-13 00:20:08 +08:00
Begin VB.TextBox num1
Enabled = 0 'False
2023-10-12 23:53:19 +08:00
Height = 495
Left = 840
TabIndex = 3
Top = 600
Width = 855
End
2023-10-13 00:20:08 +08:00
Begin VB.CommandButton quit
2023-10-12 23:53:19 +08:00
Caption = "<22>˳<EFBFBD>(&Q)"
Height = 615
2023-10-13 00:20:08 +08:00
Left = 6360
2023-10-12 23:53:19 +08:00
TabIndex = 2
Top = 2280
Width = 1575
End
2023-10-13 00:20:08 +08:00
Begin VB.CommandButton checkout
2023-10-12 23:53:19 +08:00
Caption = "<22><><EFBFBD><EFBFBD>"
2023-10-13 00:20:08 +08:00
Enabled = 0 'False
2023-10-12 23:53:19 +08:00
Height = 615
2023-10-13 00:20:08 +08:00
Left = 2520
2023-10-12 23:53:19 +08:00
TabIndex = 1
Top = 2280
Width = 1575
End
2023-10-13 00:20:08 +08:00
Begin VB.CommandButton question
2023-10-12 23:53:19 +08:00
Caption = "<22><><EFBFBD><EFBFBD>"
Height = 615
Left = 600
TabIndex = 0
Top = 2280
Width = 1575
End
2023-10-13 00:20:08 +08:00
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
2023-10-12 23:53:19 +08:00
Begin VB.Label Label2
Caption = "="
2023-10-13 00:20:08 +08:00
BeginProperty Font
Name = "<22><><EFBFBD><EFBFBD>"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
2023-10-12 23:53:19 +08:00
Height = 255
2023-10-13 00:20:08 +08:00
Left = 4080
2023-10-12 23:53:19 +08:00
TabIndex = 6
Top = 720
Width = 495
End
Begin VB.Label Label1
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 = 2040
TabIndex = 5
Top = 720
Width = 375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
2023-10-13 00:20:08 +08:00
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