📄 jsq.frm
字号:
Private Sub Command12_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "+"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command13_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "-"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command14_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "*"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command15_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "/"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command16_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "\"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command17_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "qy"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command18_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "cf"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command19_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If Text1.Text <> "" Then
fir = Val(Text1.Text)
Text1.Text = ""
pmark = "kf"
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command2_Click()
Text1.FontSize = 26
If Text1.Text = "" Then
Text1.Text = "2"
Else
Text1.Text = Text1.Text + "2"
End If
End Sub
Private Sub Command20_Click()
Dim fact As Long
Dim resu As Long
resu = 1
If Text1.Text <> "" Then
fir = Val(Text1.Text)
If Int(fir) <> fir Then
MsgBox "只有整数才可以求阶乘!"
Exit Sub
End If
If fir < 0 Then
MsgBox "数据不能小于零!"
Exit Sub
End If
If fir > 170 Then
MsgBox "数据最大不得超过170", 16, "警告窗口"
Else
If fir = 0 Or fir = 1 Then
Text1.Text = "1"
Else
For iii = fir To 2 Step -1
resu = resu * iii
Next iii
Text1.Text = Str(resu)
End If
End If
Else
MsgBox "您忘记输入数据了!", 16, "警告窗口"
End If
End Sub
Private Sub Command21_Click()
yer = Year(Now)
mnth = Month(Now)
dy = Day(Now)
Select Case Weekday(Now)
Case 1
wkd$ = "日"
Case 2
wkd$ = "一"
Case 3
wkd$ = "二"
Case 4
wkd$ = "三"
Case 5
wkd$ = "四"
Case 6
wkd$ = "五"
Case 7
wkd$ = "六"
End Select
Text1.FontSize = 20
Text1.Text = Str$(yer) + "年" + Str$(mnth) + "月" + Str$(dy) + "日 星期" + wkd$
End Sub
Private Sub Command22_Click()
Text1.FontSize = 26
hur = Hour(Now)
mnt = Minute(Now)
scn = Second(Now)
If hur <= 12 Then
pa$ = "上午"
Else
hur = hur - 12
pa$ = "下午"
End If
Text1.Text = pa$ + Str$(hur) + "点" + Str$(mnt) + "分" + Str$(scn) + "秒"
End Sub
Private Sub Command23_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
msg1$ = "现在不能进行运算!"
msg2$ = "请先清除窗口中的内容再进行运算!"
MsgBox msg1$ + Chr$(10) + Chr$(13) + msg2$, 48, "警告窗口"
Exit Sub
End If
If pmark = "jc" Then
fir = Val(Text1.Text)
Else
sec = Val(Text1.Text)
End If
If Text1.Text = "" And pmark <> "!" Then
MsgBox "忘记输入数据了!", 16, "警告窗口"
Else
Select Case pmark
Case "+"
Text1.Text = Str$(fir + sec)
Case "-"
Text1.Text = Str$(fir - sec)
Case "*"
Text1.Text = Str$(fir * sec)
Case "/"
If sec = 0 Then
MsgBox "零不能做除数!", 16, "警告窗口"
Exit Sub
End If
Text1.Text = Str$(fir / sec)
Case "\"
If sec = 0 Then
MsgBox "零不能做除数!", 16, "警告窗口"
Exit Sub
End If
If Int(fir) <> fir Or Int(sec) <> sec Then
MsgBox "只有整数才能进行整除运算", 16, "警告窗口"
Exit Sub
Else
Text1.Text = Str$(fir \ sec)
End If
Case "qy"
If Int(fir) <> fir Or Int(sec) <> sec Then
MsgBox "只有整数才能求余", 16, "警告窗口"
Exit Sub
Else
Text1.Text = Str$(fir Mod sec)
End If
Case "cf"
Text1.Text = Str$(fir ^ sec)
Case "kf"
Text1.Text = Str$(fir ^ (1 / sec))
Case "!"
If fir < 0 Or Int(fir) <> fir Then
MsgBox "只有零和自然数才能求阶乘!", 16, "警告窗口"
Exit Sub
Else
fa# = 1#
If fir = 0 Or fir = 1 Then
Text1.Text = "1"
Exit Sub
Else
For ii& = 1 To fir
fa# = fa# * ii&
Next ii&
Text1.Text = Str$(fa#)
End If
End If
End Select
End If
End Sub
Private Sub Command24_Click()
If Text1.Text = "" Then
MsgBox "没有数据可清除!", , "警告窗口"
Exit Sub
Else
Text1.Text = ""
End If
End Sub
Private Sub Command25_Click()
msg1$ = " 本程序用VB6.0写成,它不仅可以进行一般的数值计算,还可以显示日期"
msg2$ = "和时间。你还可以用和Windows应用程序相同的热键对运算结果、日期、时间"
msg3$ = "等进行编辑操作。您可以把计算器窗口中显示的任何内容进行编辑。编辑方"
msg4$ = "法是:(1)单击鼠标右键,用弹出的快捷菜单;(2)用快捷键进行操作,快捷键"
msg5$ = "说明如下:"
msg6$ = " 剪切 Ctrl+X 复制 Ctrl+C 粘帖 Ctrl+V 删除 Del"
msg7$ = Chr$(10) + Chr$(13)
msg8$ = " "
msg9$ = " "
msg10$ = " E-mail: iseries820@sina.com"
tit$ = " 帮助窗口"
MsgBox msg1$ + msg7$ + msg2$ + msg7$ + msg3$ + msg7$ + msg4$ + msg7$ + msg5$ + msg7$ + msg6$ + msg7$ + msg7$ + msg8$ + msg7$ + msg9$ + msg7$ + msg10$, 32, tit$
End Sub
Private Sub Command26_Click()
Text1.Text = Str$(Val(Text1.Text) / 100)
End Sub
Private Sub Command3_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "3"
Else
Text1.Text = Text1.Text + "3"
End If
End Sub
Private Sub Command4_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "4"
Else
Text1.Text = Text1.Text + "4"
End If
End Sub
Private Sub Command5_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "5"
Else
Text1.Text = Text1.Text + "5"
End If
End Sub
Private Sub Command6_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "6"
Else
Text1.Text = Text1.Text + "6"
End If
End Sub
Private Sub Command7_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "7"
Else
Text1.Text = Text1.Text + "7"
End If
End Sub
Private Sub Command8_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "8"
Else
Text1.Text = Text1.Text + "8"
End If
End Sub
Private Sub Command9_Click()
Text1.FontSize = 26
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") Then
Text1.Text = ""
End If
If Text1.Text = "" Then
Text1.Text = "9"
Else
Text1.Text = Text1.Text + "9"
End If
End Sub
Private Sub Form_Click()
If InStr(Text1.Text, "年") <> 0 Or InStr(Text1.Text, "点") <> 0 Or InStr(Text1.Text, "4665688-") <> 0 Then
Text1.Text = ""
End If
End Sub
Private Sub Form_Load()
If App.PrevInstance = True Then
'MsgBox "该程序已经运行,请勿重复运行!", 16, "重复运行错误"
End
End If
Text1.FontSize = 11
Text1.Text = ""
End Sub
Private Sub Timer1_Timer()
Text1.Text = Time$
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 46 Then
KeyAscii = 0
End If
If KeyAscii = Asc(".") Then
If InStr(Text1.Text, ".") <> 0 Then
KeyAscii = 0
End If
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -