1 / 13
文档名称:

VB计算器(界面设计全部代码).doc

格式:doc   大小:131KB   页数:13页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

文档介绍:实用标准文案

.
VB计算器
此计算器能够实现加减乘除等一系列的功能。还有实现显示系统时间的附加功能。


程序设计:0-9和点在command1的组内。其他的按钮式运算符和其他功能。
正切和余切有对特殊值进行警告, 除也有对除数为零的情况提示警告, 还有阶乘等一系列计
算溢出的情况提出警告,还有很多需要完善。 。。这仅供参考。
Public sum As Double
Public k As Stri ng
Public dia n As Boolea n
Public b As In teger
Public poin tflag As Boolea n
Dim clearFlag As Boolea n
Public F As Long
'Dim start As boole n
Public resl As Boolean ' 运算结果存储在 resl里
Public ff As Double 'resl 里是否为空
数字按钮在一个组内,点
'llllllllllllllllllllllllllllllllllllllllllllllllllllllll
击按钮输入数字 lllllllllllllllllllllllllllllllllllllllllll
Private Sub comma nd1_click(l ndex As In teger)
Select Case In dex
Case 1
If Not clearFlag The n ' 不是等号,那么显示 1
Text1.Text = Text1.Text & 1
Else ' 是等号,那么清空
Text1.Text = 1
clearFlag = False
End If
If Len(Text1.Text) = 2 And InStr(1, Text1, "0") = 1 Then Text1 = Right(Text1, 1)
'如果第一位的数位 0,字符串的长度为 2.那么取字符串右面的数,即两个数中右面的数
Case 2
If Not clearFlag Then
Text1.Text = Text1.Text & 2
Else
Text1.Text = 2
clearFlag = False
End If
If Len (Text1.Text) = 2 And In Str(1, Text1, "0") = 1 The n Text1 : Case 3
If Not clearFlag The n
Text1.Text = Text1.Text & 3
Else
=Right(Text1, 1)
Text1.Text clearFlag = End If
=3
False

If Len (Text1.Text) = 2 And In Str(1, Text1, "0") = 1 The n Text1 :
=Right(Text1, 1)
Case 4


If Not clearFlag The n

Text1.Text
=Text1.Text & 4

Else


Text1.Text
=4

clearFlag =
False

End If


If Len (Text1.Text) = 2 And In Str(1, Text1, "0") = 1 The n Text1 :
=Right(Text1, 1)

Case 5
If Not clearFlag Then
Textl.Text = Textl.Text & 5
Else
Textl.Text = 5
clearFlag = False
End If
If Len(Text1.Text) = 2 And InStr(1, Text1, "0")=
=1 The n Text1 =
=Right(Text1, 1)
Case 6



If Not clearFlag The n


Text1.Text
=Text1.Text & 6


Else



Text1.Text
=6


clearFlag = End If
False


If Len(Text1.Text) = 2 And InStr(1, Text1, "0")=
=1 The n Text1 =
=Right(Text1, 1)

Case 7
If Not clearFlag The n
Text1.Text = Text1.Text & 7
Else
Te

分享好友

预览全文

VB计算器(界面设计全部代码).doc

上传人:guoxiachuanyue 2021/9/15 文件大小:131 KB

下载得到文件列表

VB计算器(界面设计全部代码).doc

相关文档