📄 5-15.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3825
ClientLeft = 60
ClientTop = 450
ClientWidth = 7185
BeginProperty Font
Name = "幼圆"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 3825
ScaleWidth = 7185
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "÷"
Height = 495
Index = 15
Left = 4200
TabIndex = 16
Top = 3000
Width = 615
End
Begin VB.CommandButton Command1
Caption = "×"
Height = 495
Index = 14
Left = 4200
TabIndex = 15
Top = 2400
Width = 615
End
Begin VB.CommandButton Command1
Caption = "-"
Height = 495
Index = 13
Left = 4200
TabIndex = 14
Top = 1800
Width = 615
End
Begin VB.CommandButton Command1
Caption = "+"
Height = 495
Index = 12
Left = 4200
TabIndex = 13
Top = 1200
Width = 615
End
Begin VB.CommandButton Command1
Caption = "="
Height = 495
Index = 11
Left = 3240
TabIndex = 12
Top = 3000
Width = 615
End
Begin VB.CommandButton Command1
Caption = "."
Height = 495
Index = 10
Left = 2280
TabIndex = 11
Top = 3000
Width = 615
End
Begin VB.CommandButton Command1
Caption = "9"
Height = 495
Index = 9
Left = 3240
TabIndex = 10
Top = 2400
Width = 615
End
Begin VB.CommandButton Command1
Caption = "8"
Height = 495
Index = 8
Left = 2280
TabIndex = 9
Top = 2400
Width = 615
End
Begin VB.CommandButton Command1
Caption = "7"
Height = 495
Index = 7
Left = 1320
TabIndex = 8
Top = 2400
Width = 615
End
Begin VB.CommandButton Command1
Caption = "6"
Height = 495
Index = 6
Left = 3240
TabIndex = 7
Top = 1800
Width = 615
End
Begin VB.CommandButton Command1
Caption = "5"
Height = 495
Index = 5
Left = 2280
TabIndex = 6
Top = 1800
Width = 615
End
Begin VB.CommandButton Command1
Caption = "4"
Height = 495
Index = 4
Left = 1320
TabIndex = 5
Top = 1800
Width = 615
End
Begin VB.CommandButton Command1
Caption = "3"
Height = 495
Index = 3
Left = 3240
TabIndex = 4
Top = 1200
Width = 615
End
Begin VB.CommandButton Command1
Caption = "2"
Height = 495
Index = 2
Left = 2280
TabIndex = 3
Top = 1200
Width = 615
End
Begin VB.CommandButton Command1
Caption = "1"
Height = 495
Index = 1
Left = 1320
TabIndex = 2
Top = 1200
Width = 615
End
Begin VB.CommandButton Command1
Caption = "0"
Height = 495
Index = 0
Left = 1320
TabIndex = 1
Top = 3000
Width = 615
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
Height = 420
Left = 600
TabIndex = 0
Text = "0"
Top = 600
Width = 5055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a, b, flag As Integer
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0 To 10
If flag = 0 Then Text1.Text = "": flag = 1
Text1.Text = Text1.Text & Command1(Index).Caption
Case 12 To 15
a = Text1.Text
Text1.Tag = Command1(Index).Caption
Text1.Text = ""
Case 11
If flag = 1 Then b = Text1.Text
Select Case Text1.Tag
Case "+"
Text1.Text = a & "+" & b & "=" & (Val(a) + Val(b))
Case "-"
Text1.Text = a & "-" & b & "=" & (Val(a) - Val(b))
Case "×"
Text1.Text = a & "×" & b & "=" & (Val(a) * Val(b))
Case "÷"
Text1.Text = a & "÷" & b & "=" & (Val(a) / Val(b))
End Select
flag = 0
End Select
End Sub
Private Sub Form_Activate()
flag = 0
Text1.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -