📄 加法练习.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "加法练习"
ClientHeight = 2520
ClientLeft = 60
ClientTop = 450
ClientWidth = 2955
LinkTopic = "Form1"
ScaleHeight = 2520
ScaleWidth = 2955
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 375
Left = 1080
TabIndex = 5
Top = 120
Width = 615
End
Begin VB.CommandButton Command2
Caption = "确定"
Height = 375
Left = 1920
TabIndex = 3
Top = 840
Width = 855
End
Begin VB.CommandButton Command1
Caption = "出题"
Height = 375
Left = 1920
TabIndex = 2
Top = 120
Width = 855
End
Begin VB.TextBox Text2
Height = 375
Left = 120
TabIndex = 1
Top = 840
Width = 1575
End
Begin VB.TextBox Text1
Enabled = 0 'False
Height = 375
Left = 120
TabIndex = 0
Top = 120
Width = 615
End
Begin VB.Label Label2
Caption = "+"
Height = 255
Left = 840
TabIndex = 6
Top = 240
Width = 255
End
Begin VB.Label Label1
Caption = "结果"
Height = 735
Left = 120
TabIndex = 4
Top = 1560
Width = 2655
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim x, y
Private Sub Command1_Click()
Randomize
x = Int(Rnd * 89 + 10)
y = Int(Rnd * 89 + 10)
Text1 = x
Text3 = y
Text2.SetFocus
End Sub
Private Sub Command2_Click()
Dim a, b
a = Val(Text2.Text)
b = x + y
If (a = b) Then
Label1 = "您真的很聪明啊!"
Else
Label1 = "您的答案是错误的!请重新计算!"
End If
Text2 = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -