《2022年vb简单的计算机源代码 2.pdf》由会员分享,可在线阅读,更多相关《2022年vb简单的计算机源代码 2.pdf(9页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、vb 简单的计算机源代码.txt如果青春的时光在闲散中度过,那么回忆岁月将是一场凄凉的悲剧。杂草多的地方庄稼少,空话多的地方智慧少。即使路上没有花朵,我仍可以欣赏荒芜。Private Sub Command1_Click() Form1.Caption = 欢迎使用智能计算器 载入默认正常显示If Check1.Value = 0 Then 1类分歧ElseIf Text1.Text = Or Text2.Text = Then 2类分歧Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And T
2、ext2.Text = Then 2类分歧Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else 2类分歧Dim a, b, c As Double a = Val(Text1.Text) b = Val(Text2.Text) c = a + b Text3.Text = c Text1.Text = Text2.Text = End If If Check1.Value = 1 Then 1类分歧ElseIf Text1.Text = Or Text2.Text = Then 2类分歧Form1.Caption = xatali
3、q kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then 2类分歧Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else 2类分歧Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d + e Text3.Text = f End If End Sub Private Sub Command2_Click() Form1.Caption = 欢迎使用智能计算器 If
4、 Check1.Value = 1 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 9 页 - - - - - - - - - Form1.Caption = xataliq kuruldi
5、Text3.Text = 运算数值不能为空 Else Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d - e Text3.Text = f End If If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = x
6、ataliq kuruldi Text3.Text = 运算数值不能为空 Else Dim a, b, c As Double a = Val(Text1.Text) b = Val(Text2.Text) c = a - b Text3.Text = c Text1.Text = Text2.Text = End If End Sub Private Sub Command3_Click() Form1.Caption = 欢迎使用智能计算器 If Check1.Value = 1 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Cap
7、tion = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d * e Text3.Text = f End If 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精
8、心整理 - - - - - - - 第 2 页,共 9 页 - - - - - - - - - If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else Dim a, b, c As Double a = Val(T
9、ext1.Text) b = Val(Text2.Text) c = a * b Text3.Text = c Text1.Text = Text2.Text = End If End Sub Private Sub Command4_Click() Form1.Caption = 欢迎使用智能计算器 If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text
10、2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Val(Text2.Text) = 0 Then Form1.Caption = xataliq kuruldi Text3.Text = 分数的分子不能为零 Else Dim a, b, c As Double a = Val(Text1.Text) b = Val(Text2.Text) c = a / b Text3.Text = c Text1.Text = Text2.Text = End If If Check1.Value = 1
11、Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 9 页 - - - - - - - - - ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不
12、能为空 ElseIf Val(Text2.Text) = 0 Then Form1.Caption = xataliq kuruldi Text3.Text = 分数的分子不能为零 Else Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d / e Text3.Text = f End If End Sub Private Sub Command5_Click() Form1.Caption = 欢迎使用智能计算器 Text1.Text = Text2.Text = Text3.Text = End Sub
13、Private Sub Command6_Click() Form1.Caption = 欢迎使用智能计算器 Form1.Hide Form3.Show End Sub Private Sub Command7_Click() End End Sub Private Sub Command8_Click() Form1.Caption = 欢迎使用智能计算器 If Text3.Text Then Text1.Text = Text3.Text Text2.Text = Text3.Text = Else Form1.Caption = xataliq kuruldi Text3.Text =
14、没有结果无法继续 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 9 页 - - - - - - - - - End If End Sub Private Sub Text2_Change() End Sub Private Sub 乘_Click() Form1.Caption = 欢迎使用智能计算器 If Check1.Value = 1 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xat
15、aliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d * e Text3.Text = f End If If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form
16、1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else Dim a, b, c As Double a = Val(Text1.Text) b = Val(Text2.Text) c = a * b Text3.Text = c Text1.Text = Text2.Text = End If End Sub Private Sub 除_Click()
17、 Form1.Caption = 欢迎使用智能计算器 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 9 页 - - - - - - - - - If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then For
18、m1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Val(Text2.Text) = 0 Then Form1.Caption = xataliq kuruldi Text3.Text = 分数的分子不能为零 Else Dim a, b, c As Double a = Val(Text1.Text) b = Val(Text2.Text) c = a / b Text3.Text = c Text1.Text = Text2.Text = End If If Check1.Value = 1 Then ElseIf Text1
19、.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = 错误 Text3.Text = 运算数值不能为空 ElseIf Val(Text2.Text) = 0 Then Form1.Caption = 错误 Text3.Text = 分数的分子不能为零 Else Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2
20、.Text) f = d / e Text3.Text = f End If End Sub Private Sub munasiwetlik_Click() Form1.Caption = 欢迎使用智能计算器 Form1.Hide Form3.Show End Sub 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 9 页 - - - - - - - - - Private Sub 继续 _Click() Form1.Caption = 欢迎使用智能计算器 If Tex
21、t3.Text Then Text1.Text = Text3.Text Text2.Text = Text3.Text = Else Form1.Caption = xataliq Text3.Text = 没有结果无法继续 End If End Sub Private Sub 加_Click() Form1.Caption = 欢迎使用智能计算器 If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Els
22、eIf Text1.Text = And Text2.Text = Then Form1.Caption = 错误 Text3.Text = 运算数值不能为空 Else Dim a, b, c As Double a = Val(Text1.Text) b = Val(Text2.Text) c = a + b Text3.Text = c Text1.Text = Text2.Text = End If If Check1.Value = 1 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kurul
23、di Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 Else Dim d, e, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d + e Text3.Text = f 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 9
24、 页 - - - - - - - - - End If End Sub Private Sub 减_Click() Form1.Caption = 欢迎使用智能计算器 If Check1.Value = 1 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = xataliq kuruldi Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = 错误 Text3.Text = 运算数值不能为空 Else Dim d, e
25、, f As Double d = Val(Text1.Text) e = Val(Text2.Text) f = d - e Text3.Text = f End If If Check1.Value = 0 Then ElseIf Text1.Text = Or Text2.Text = Then Form1.Caption = 错误 Text3.Text = 运算数值不能为空 ElseIf Text1.Text = And Text2.Text = Then Form1.Caption = 错误 Text3.Text = 运算数值不能为空 Else Dim a, b, c As Doub
26、le a = Val(Text1.Text) b = Val(Text2.Text) c = a - b Text3.Text = c Text1.Text = Text2.Text = End If End Sub Private Sub 清空 _Click() Form1.Caption = 欢迎使用智能计算器 Text1.Text = Text2.Text = Text3.Text = End Sub 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 9 页 - - - - - - - - - - form2 ? ? ? Private Sub Command1_Click() Form3.Hide Form1.Show Form1.Text3.Text = End Sub Private Sub Command2_Click() End End Sub 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 9 页 - - - - - - - - -