?? form1.frm
字號:
Left = 3705
TabIndex = 18
Top = 2610
Width = 495
End
Begin VB.CommandButton Command21
Caption = "J"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4230
TabIndex = 17
Top = 2610
Width = 495
End
Begin VB.CommandButton Command22
Caption = "K"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4755
TabIndex = 16
Top = 2610
Width = 495
End
Begin VB.CommandButton Command23
Caption = "L"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5295
TabIndex = 15
Top = 2610
Width = 495
End
Begin VB.CommandButton Command24
Caption = "Enter"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 14
Top = 3090
Width = 1035
End
Begin VB.CommandButton Command25
Caption = "Z"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1050
TabIndex = 13
Top = 3090
Width = 495
End
Begin VB.CommandButton Command26
Caption = "X"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1578
TabIndex = 12
Top = 3090
Width = 495
End
Begin VB.CommandButton Command27
Caption = "C"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2106
TabIndex = 11
Top = 3090
Width = 495
End
Begin VB.CommandButton Command28
Caption = "V"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2634
TabIndex = 10
Top = 3090
Width = 495
End
Begin VB.CommandButton Command29
Caption = "B"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3162
TabIndex = 9
Top = 3090
Width = 495
End
Begin VB.CommandButton Command30
Caption = "N"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3690
TabIndex = 8
Top = 3090
Width = 495
End
Begin VB.CommandButton Command31
Caption = "M"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4218
TabIndex = 7
Top = 3090
Width = 495
End
Begin VB.CommandButton Command32
Caption = "Spa"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4746
TabIndex = 6
Top = 3090
Width = 495
End
Begin VB.CommandButton Command35
Caption = "+/-"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5820
TabIndex = 5
Top = 2610
Width = 495
End
Begin VB.CommandButton Command4
Caption = "關 閉"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 4
Top = 2130
Width = 615
End
Begin VB.CommandButton Command3
Caption = "計 算"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 3
Top = 2610
Width = 615
End
Begin VB.CommandButton Command1
Caption = "英 漢"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 2
Top = 3090
Width = 615
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1215
Left = 420
MultiLine = -1 'True
TabIndex = 1
Top = 600
Width = 5775
End
Begin VB.Image Image1
Height = 3675
Left = 270
Picture = "Form1.frx":0007
Top = 390
Width = 6120
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public compute As Single '標志:0為英文,1為運算,2為運算結果,3為出錯標志,4為翻譯
Public poi As Single '小數點標志
Public sign As Single '操作數及結果的正負號判斷
Public operator As String '+、-、*、/ 操作運算符
Public result As Double '運算結果
Private Sub Command1_Click()
compute = 0
Text1.Text = ""
Text1.Alignment = 0
Command5.Enabled = True
Command6.Enabled = True
Command7.Enabled = True
Command8.Enabled = True
Command9.Enabled = True
Command15.Enabled = True
Command16.Enabled = True
Command17.Enabled = True
Command18.Enabled = True
Command19.Enabled = True
Command25.Enabled = True
Command26.Enabled = True
Command27.Enabled = True
Command28.Enabled = True
Command29.Enabled = True
Command10.Caption = "Y"
Command11.Caption = "U"
Command12.Caption = "I"
Command13.Caption = "O"
Command14.Caption = "P"
Command20.Caption = "H"
Command21.Caption = "J"
Command22.Caption = "K"
Command23.Caption = "L"
Command24.Caption = "Enter"
Command30.Caption = "N"
Command31.Caption = "M"
Command32.Caption = "Spa"
End Sub
Private Sub Command10_Click()
If compute = 0 Then Text1.Text = Text1.Text + "y"
If compute = 4 Then Text1.Text = "y": compute = 0
If compute = 1 Then
If Text1.Text = "0" Then Text1.Text = "7" Else Text1.Text = Text1.Text + "7"
End If
If compute = 2 Then
Text1.Text = "7"
compute = 1
sign = 1
End If
End Sub
Private Sub Command11_Click()
If compute = 0 Then Text1.Text = Text1.Text + "u"
If compute = 4 Then Text1.Text = "u": compute = 0
If compute = 1 Then
If Text1.Text = "0" Then Text1.Text = "8" Else Text1.Text = Text1.Text + "8"
End If
If compute = 2 Then
Text1.Text = "8"
compute = 1
sign = 1
End If
End Sub
Private Sub Command12_Click()
If compute = 0 Then Text1.Text = Text1.Text + "i"
If compute = 4 Then Text1.Text = "i": compute = 0
If compute = 1 Then
If Text1.Text = "0" Then Text1.Text = "9" Else Text1.Text = Text1.Text + "9"
End If
If compute = 2 Then
Text1.Text = "9"
compute = 1
sign = 1
End If
End Sub
Private Sub Command13_Click()
If compute = 0 Then Text1.Text = Text1.Text + "o"
If compute = 4 Then Text1.Text = "o": compute = 0
If compute = 1 Then
Select Case operator '選擇運算符運算
Case "", "+"
result = result + Val(Text1.Text)
Case "-"
result = result - Val(Text1.Text)
Case "*"
result = result * Val(Text1.Text)
Case "/"
If Val(Text1.Text) = 0 Then
compute = 3 '設置出錯標志'
Text1.Text = "注意:除數不能為0!請按復位鍵重新開始。"
Else
result = result / Val(Text1.Text)
End If
End Select
operator = "+" '做加法 ,下,同理
poi = 0
sign = Sgn(result)
If compute = 1 Then
compute = 2
Text1.Text = Str(result)
End If
End If
If compute = 2 Then
operator = "+"
result = Val(Text1.Text)
sign = Sgn(result)
End If
End Sub
Private Sub Command14_Click()
If compute = 0 Then Text1.Text = Text1.Text + "p"
If compute = 4 Then Text1.Text = "p": compute = 0
If compute = 1 Then
Select Case operator '選擇運算符運算
Case "", "+"
result = result + Val(Text1.Text)
Case "-"
result = result - Val(Text1.Text)
Case "*"
result = result * Val(Text1.Text)
Case "/"
If Val(Text1.Text) = 0 Then
compute = 3 '設置出錯標志'
Text1.Text = "注意:除數不能為0!請按復位鍵重新開始。"
Else
result = result / Val(Text1.Text)
End If
End Select
operator = "-"
poi = 0
sign = Sgn(result)
If compute = 1 Then
compute = 2
Text1.Text = Str(result)
End If
End If
If compute = 2 Then
operator = "-"
result = Val(Text1.Text)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -