资源预览内容
第1页 / 共9页
亲,该文档总共9页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
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.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 kuruldiText3.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 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 = Val(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 = Val(Text1.Text)b = Val(Text2.Text)c = a - bText3.Text = cText1.Text = Text2.Text = End IfEnd 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 = Val(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 = 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 = 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.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 = 分数的分子不能为零ElseDim d, e, f As Doubled = Val(Text1.Text)e = 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()Form1.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 = 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 ThenElseIf Text1.Text = Or Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空ElseIf Text1.Text = And Text2.Text = ThenForm1.Caption = xataliq kuruldiText3.Text = 运算数值不能为空
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号