给我你的邮箱,我把工程发过去
代码
DimpiAsDouble
DimtempAsDouble
DimjAsInteger
DimteAsString
DimyfAsString
DimmAsBoolean
DimfAsBoolean
PrivateSubCommand1_Click(IndexAsInteger)
Iff=TrueThenText1=""
IfIndex=10Then
Text1.Text=Text1.Text&"."
Else
Text1.Text=Text1.Text&Index
EndIf
f=False
EndSub
PrivateSubCommand2_Click(IndexAsInteger)
Callkl
temp=Text1
Text1=""
Text1=Command2(Index).Caption
f=True
yf=Command2(Index).Caption
EndSub
PrivateSubCommand3_Click()
Ifm=TrueThen
Callkl
Else
SelectCaseyf
Case"+"
Text1=temp+Val(Text1)
Case"-"
Text1=temp-Val(Text1)
Case"*"
Text1=temp*Val(Text1)
Case"/"
IfVal(Text1)=0Then
MsgBox"除数不为0"
Else
Text1=temp/Val(Text1)
EndIf
EndSelect
EndIf
EndSub
Subkl()
Ifm=TrueThen
a=Val(Replace(Text1,te,""))
Ifte="sin"Then
IfOption1.Value=TrueThen
Text1=Sin(a*pi/180)
Else
a=Val(Replace(Text1,"π/",""))
Text1=Sin(pi/a)
EndIf
ElseIfte="sprt"Then
Text1=Sqr(a)
ElseIfte="1/x"Then
Text1=1/a
ElseIfte="%"Then
Text1=a*100
ElseIfte="cos"Then
IfOption1.Value=TrueThen
Text1=Cos(a*pi/180)
Else
a=Val(Replace(Text1,"π/",""))
Text1=Cos(pi/a)
EndIf
ElseIfte="tan"Then
IfOption1.Value=TrueThen
Text1=Tan(a*pi/180)
Else
a=Val(Replace(Text1,"π/",""))
Text1=Tan(pi/a)
EndIf
ElseIfte="ln"Then'等号的ln计算
Text1=Log(Val(Text1.Text))
EndIf
m=False
EndIf
EndSub
PrivateSubCommand4_Click()
Text1.Text=Mid(Text1,1,Len(Text1.Text)-1)
EndSub
PrivateSubCommand5_Click()
Text1.Text=""
temp=0
m=False
EndSub
PrivateSubCommand6_Click(IndexAsInteger)
Text1.Text=Command6(Index).Caption
te=Command6(Index).Caption
m=True
EndSub
PrivateSubCommand7_Click()
End
EndSub
PrivateSubCommand8_Click()
Text1="π/"
EndSub
PrivateSubForm_Load()
pi=4*Atn(1)
EndSub