📄 calculator.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Calculator"
ClientHeight = 4005
ClientLeft = 165
ClientTop = 735
ClientWidth = 4725
Icon = "calculator.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4005
ScaleWidth = 4725
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command12
Caption = "Exit"
Height = 495
Left = 2160
TabIndex = 23
Top = 3360
Width = 1455
End
Begin VB.CommandButton Command11
Caption = "Help"
Height = 495
Left = 480
TabIndex = 22
Top = 3360
Width = 1455
End
Begin VB.Frame Frame3
Caption = "Logical"
Height = 615
Left = 1440
TabIndex = 19
Top = 2280
Visible = 0 'False
Width = 2055
Begin VB.CommandButton Command9
Caption = ">"
Height = 375
Left = 240
TabIndex = 21
Top = 240
Width = 375
End
Begin VB.CommandButton Command10
Caption = "<"
Height = 375
Left = 960
TabIndex = 20
Top = 240
Width = 375
End
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 8000
Left = 3720
Top = 600
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 6000
Left = 3840
Top = 2160
End
Begin VB.Frame Frame2
Caption = "Scientifc"
Height = 735
Left = 1440
TabIndex = 12
Top = 2160
Visible = 0 'False
Width = 2175
Begin VB.CommandButton Command5
Caption = "%"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 18
Top = 240
Width = 495
End
Begin VB.CommandButton Command8
Caption = "x^y"
Height = 375
Left = 1080
TabIndex = 15
Top = 240
Width = 495
End
Begin VB.CommandButton Command7
Caption = "x^3"
Height = 375
Left = 600
TabIndex = 14
Top = 240
Width = 495
End
Begin VB.CommandButton Command6
Caption = "x^2"
Height = 375
Left = 120
TabIndex = 13
Top = 240
Width = 495
End
End
Begin VB.OptionButton Option3
Caption = "Logical"
Height = 375
Left = 120
TabIndex = 11
Top = 2760
Width = 1095
End
Begin VB.OptionButton Option2
Caption = "Scientific"
Height = 315
Left = 120
TabIndex = 10
Top = 2400
Width = 1095
End
Begin VB.OptionButton Option1
Caption = "Operators"
Height = 375
Left = 120
TabIndex = 9
Top = 1920
Width = 1095
End
Begin VB.TextBox Text2
Height = 285
Left = 1080
MaxLength = 10
TabIndex = 8
Top = 1440
Width = 1095
End
Begin VB.Frame Frame1
Caption = "Operators"
Height = 735
Left = 1440
TabIndex = 3
Top = 2040
Visible = 0 'False
Width = 2175
Begin VB.CommandButton Command1
Caption = "+"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 7
Top = 240
Width = 495
End
Begin VB.CommandButton Command4
Caption = "x"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 6
Top = 240
Width = 495
End
Begin VB.CommandButton Command3
Caption = "/"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1080
TabIndex = 5
Top = 240
Width = 495
End
Begin VB.CommandButton Command2
Caption = "-"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 4
Top = 240
Width = 495
End
End
Begin VB.TextBox Text1
BeginProperty DataFormat
Type = 1
Format = "0"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 1033
SubFormatType = 1
EndProperty
Height = 285
Left = 0
MaxLength = 10
TabIndex = 2
Top = 1440
Width = 1095
End
Begin VB.Label Label4
Caption = "="
Height = 255
Left = 2280
TabIndex = 17
Top = 1440
Width = 255
End
Begin VB.Label Label3
Height = 255
Left = 2640
TabIndex = 16
Top = 1440
Width = 1935
End
Begin VB.Label Label2
Caption = "Version : 3.1"
Height = 255
Left = 1920
TabIndex = 1
Top = 960
Width = 975
End
Begin VB.Label Label1
Caption = "Calculator"
BeginProperty Font
Name = "Arial"
Size = 29.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 840
TabIndex = 0
Top = 120
Width = 3015
End
Begin VB.Menu mnufile
Caption = "File"
Begin VB.Menu mnufileres
Caption = "Restart"
End
Begin VB.Menu sep
Caption = "-"
End
Begin VB.Menu mnufileexit
Caption = "Exit"
End
End
Begin VB.Menu mnuhelp
Caption = "Help"
Begin VB.Menu mnuhelpabo
Caption = "About"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Label3 = Val(Text1) + Val(Text2)
End Sub
Private Sub Command10_Click()
Label3 = Text1 < Text2
End Sub
Private Sub Command11_Click()
frmAbout.Show
End Sub
Private Sub Command12_Click()
MsgBox "Thank You for choosing Shan's calculator", , "By"
Unload Me
End Sub
Private Sub Command2_Click()
Label3 = Text1 - Text2
End Sub
Private Sub Command3_Click()
Label3 = Text1 / Text2
End Sub
Private Sub Command4_Click()
Label3 = Text1 * Text2
End Sub
Private Sub Command5_Click()
Text2.Visible = True
Text1.Text = "Marks.Ob"
Text2.Text = "T.Marks"
MsgBox "You Have few Seconds To enter Values.If u want to cancel then go to file menu and then click restart to restart it", , "Calculator"
Timer2.Enabled = True
End Sub
Private Sub Command6_Click()
Label3 = Text1 ^ 2
End Sub
Private Sub Command7_Click()
Label3 = Text1 ^ 3
End Sub
Private Sub Command8_Click()
Text2.Visible = True
MsgBox "Please Enter Second Value To continue.You have Limited Time(few seconds) ", , "Calculator"
If Text2.Visible = True Then
Timer1.Enabled = True
End If
End Sub
Private Sub Command9_Click()
Label3 = Text1 > Text2
End Sub
Private Sub mnufileexit_Click()
MsgBox "Thank You for choosing Shan's calculator", , "By"
Unload Me
End Sub
Private Sub mnufileres_Click()
Unload Me
frmSplash.Show
End Sub
Private Sub mnuhelpabo_Click()
frmAbout.Show
End Sub
Private Sub Option1_Click()
Frame1.Visible = True
Frame2.Visible = False
Frame3.Visible = False
If Text2.Visible = False Then
Text2.Visible = True
End If
End Sub
Private Sub Option2_Click()
Frame1.Visible = False
Frame2.Visible = True
Frame3.Visible = False
Text2.Visible = False
End Sub
Private Sub Option3_Click()
Frame3.Visible = True
Frame1.Visible = False
Frame2.Visible = False
If Text2.Visible = False Then
Text2.Visible = True
End If
End Sub
Private Sub Timer1_Timer()
If Text2 = "T.marks" Then
MsgBox "Plz We Are Giving You Some Time To Enter.If You Want To Close It Click File Menu And Then Click Restart Button To Reload It Under The Limited Time. ", vbDefaultButton1, "Calculator"
Else
Label3 = Text1 ^ Text2
End If
End Sub
Private Sub Timer2_Timer()
On Error Resume Next
If Text2 = "T.Marks" Then
MsgBox "You Have few Seconds To enter Values.If u want to cancel then go to file menu and then click restart to restart it", , "Calculator"
Else
Label3 = (Text1 * 100) / Text2
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -