《vb简单的计算机源代码.doc》由会员分享,可在线阅读,更多相关《vb简单的计算机源代码.doc(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 kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2
2、.Text = Then 2类分歧Form1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空Else 2类分歧Dim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a + bText3.Text = cText1.Text = Text2.Text = End IfIf Check1.Value = 1 Then 1类分歧ElseIf Text1.Text = Or Text2.Text = Then 2类分歧Form1.Caption = xataliq kuruldiTex
3、t3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = Then 2类分歧Form1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空Else 2类分歧Dim d, e, f As Doubled = Val(Text1.Text)e = Val(Text2.Text)f = d + eText3.Text = fEnd IfEnd SubPrivate Sub Command2_Click()Form1.Caption = 欢迎使用智能计算器If Check1.Value = 1 ThenEls
4、eIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim d, e, f As Doubled = Val(Text1.Text)e = Val(Text2.Text)f = d - eText3.Text = fEnd IfIf Check1.Value = 0 ThenEl
5、seIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a - bText3.Text = cText1.Text = Text2.Text = End I
6、fEnd SubPrivate Sub Command3_Click()Form1.Caption = 欢迎使用智能计算器If Check1.Value = 1 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim d, e, f As Doubled = V
7、al(Text1.Text)e = Val(Text2.Text)f = d * eText3.Text = fEnd IfIf Check1.Value = 0 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim a, b, c As Doublea =
8、Val(Text1.Text)b = Val(Text2.Text)c = a * bText3.Text = cText1.Text = Text2.Text = End IfEnd SubPrivate Sub Command4_Click()Form1.Caption = 欢迎使用智能计算器If Check1.Value = 0 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text
9、= ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Val(Text2.Text) = 0 ThenForm1.Caption = xataliq kuruldiText3.Text = 分数的分子不能为零ElseDim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a / bText3.Text = cText1.Text = Text2.Text = End IfIf Check1.Value = 1 ThenElseIf Text1.Tex
10、t = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Val(Text2.Text) = 0 ThenForm1.Caption = xataliq kuruldiText3.Text = 分数的分子不能为零ElseDim d, e, f As Doubled = Val(Text1.Text)e =
11、 Val(Text2.Text)f = d / eText3.Text = fEnd IfEnd SubPrivate Sub Command5_Click()Form1.Caption = 欢迎使用智能计算器Text1.Text = Text2.Text = Text3.Text = End SubPrivate Sub Command6_Click()Form1.Caption = 欢迎使用智能计算器Form1.HideForm3.ShowEnd SubPrivate Sub Command7_Click()EndEnd SubPrivate Sub Command8_Click()For
12、m1.Caption = 欢迎使用智能计算器If Text3.Text ThenText1.Text = Text3.TextText2.Text = Text3.Text = ElseForm1.Caption = xataliq kuruldiText3.Text = 没有结果无法继续End IfEnd SubPrivate Sub Text2_Change()End SubPrivate Sub 乘_Click()Form1.Caption = 欢迎使用智能计算器If Check1.Value = 1 ThenElseIf Text1.Text = Or Text2.Text = The
13、nForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim d, e, f As Doubled = Val(Text1.Text)e = Val(Text2.Text)f = d * eText3.Text = fEnd IfIf Check1.Value = 0 ThenElseIf Text1.Text = Or Text2.Text = Th
14、enForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a * bText3.Text = cText1.Text = Text2.Text = End IfEnd SubPrivate Sub 除_Click()Form1.C
15、aption = 欢迎使用智能计算器If Check1.Value = 0 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Val(Text2.Text) = 0 ThenForm1.Caption = xataliq kuruldiText3.Text
16、= 分数的分子不能为零ElseDim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a / bText3.Text = cText1.Text = Text2.Text = End IfIf Check1.Value = 1 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption
17、= 错误Text3.Text = 运算数值不能为空ElseIf Val(Text2.Text) = 0 ThenForm1.Caption = 错误Text3.Text = 分数的分子不能为零ElseDim d, e, f As Doubled = Val(Text1.Text)e = Val(Text2.Text)f = d / eText3.Text = fEnd IfEnd SubPrivate Sub munasiwetlik_Click()Form1.Caption = 欢迎使用智能计算器Form1.HideForm3.ShowEnd SubPrivate Sub 继续_Click(
18、)Form1.Caption = 欢迎使用智能计算器If Text3.Text ThenText1.Text = Text3.TextText2.Text = Text3.Text = ElseForm1.Caption = xataliqText3.Text = 没有结果无法继续End IfEnd SubPrivate Sub 加_Click()Form1.Caption = 欢迎使用智能计算器If Check1.Value = 0 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3
19、.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = 错误Text3.Text = 运算数值不能为空ElseDim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a + bText3.Text = cText1.Text = Text2.Text = End IfIf Check1.Value = 1 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xatali
20、q kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseDim d, e, f As Doubled = Val(Text1.Text)e = Val(Text2.Text)f = d + eText3.Text = fEnd IfEnd SubPrivate Sub 减_Click()Form1.Caption = 欢迎使用智能计算器If Check1.Value = 1 ThenElseIf T
21、ext1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = 错误Text3.Text = 运算数值不能为空ElseDim d, e, f As Doubled = Val(Text1.Text)e = Val(Text2.Text)f = d - eText3.Text = fEnd IfIf Check1.Value = 0 ThenElseIf Text1.Text =
22、Or Text2.Text = ThenForm1.Caption = 错误Text3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = 错误Text3.Text = 运算数值不能为空ElseDim a, b, c As Doublea = Val(Text1.Text)b = Val(Text2.Text)c = a - bText3.Text = cText1.Text = Text2.Text = End IfEnd SubPrivate Sub 清空_Click()Form1.Caption = 欢迎使用智能计算器Text1.Text = Text2.Text = Text3.Text = End Sub-form2 ? ? ?Private Sub Command1_Click()Form3.HideForm1.ShowForm1.Text3.Text = End SubPrivate Sub Command2_Click()EndEnd Sub