📄 出题.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "计算"
ClientHeight = 1875
ClientLeft = 60
ClientTop = 345
ClientWidth = 4410
LinkTopic = "Form1"
ScaleHeight = 1875
ScaleWidth = 4410
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
Height = 390
Left = 3120
TabIndex = 11
Top = 600
Width = 1095
End
Begin VB.CommandButton Command4
Caption = "显示答案"
Height = 375
Left = 2160
TabIndex = 9
Top = 1200
Width = 975
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 3240
TabIndex = 8
Top = 1200
Width = 975
End
Begin VB.CommandButton Command2
Caption = "判题"
Height = 375
Left = 1200
TabIndex = 7
Top = 1200
Width = 855
End
Begin VB.CommandButton Command1
Caption = "出题"
Height = 375
Left = 120
TabIndex = 6
Top = 1200
Width = 855
End
Begin VB.TextBox Text3
Height = 375
Left = 840
TabIndex = 5
Top = 600
Width = 1095
End
Begin VB.TextBox Text2
Height = 375
Left = 3120
TabIndex = 4
Top = 120
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 840
TabIndex = 3
Top = 120
Width = 1095
End
Begin VB.Label Label4
Caption = "标准答案:"
Height = 255
Left = 2040
TabIndex = 10
Top = 720
Width = 975
End
Begin VB.Label Label3
Caption = "判断:"
Height = 375
Left = 120
TabIndex = 2
Top = 600
Width = 615
End
Begin VB.Label Label2
Caption = "输入结果:"
Height = 375
Left = 2040
TabIndex = 1
Top = 120
Width = 975
End
Begin VB.Label Label1
Caption = "题目:"
Height = 375
Left = 120
TabIndex = 0
Top = 120
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public a, b, x As Integer
Private Sub Command1_Click()
Randomize Timer
a = Int(Rnd * 9 + 1)
b = Int(Rnd * 9 + 1)
Text1.Text = Str$(a) + "×" + Str$(b) + "= "
Text2.Text = ""
Text3.Text = ""
Command2.Enabled = True
Command2.Default = True
Command1.Enabled = False
Text1.SetFocus
End Sub
Private Sub Command2_Click()
x = Val(Text2.Text)
If x = a * b Then
Text3.Text = "正确"
Else
Text3.Text = "错误"
End If
Command1.Enabled = True
Command1.Default = True
Command2.Enabled = False
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Command4_Click()
Text4.Text = a * b
End Sub
Private Sub Form_Load()
Command2.Enabled = False
Text1.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -