欢迎来到天天文库
浏览记录
ID:24478693
大小:70.18 KB
页数:3页
时间:2018-11-14
《vb简单计算器编程代码附》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、PublicsumAsDoublePublickAsString"定义全局变量PrivateSubCommand1_Click(IndexAsInteger)SelectCaseIndexCase1Text1.Text=Text1.Text&1Case2Text1.Text=Text1.Text&2Case3Text1.Text=Text1.Text&3Case4Text1.Text=Text1.Text&4Case5Text1.Text=Text1.Text&5Case6Text1.Text=Text1.
2、Text&6Case7Text1.Text=Text1.Text&7Case8Text1.Text=Text1.Text&8Case9Text1.Text=Text1.Text&9Case0Text1.Text=Text1.Text&0Case10Text1.Text=Text1.Text&"."EndSelectEndSubPrivateSubCommand2_Click()sum=Text1.TextText1.Text=""k="+"EndSubPrivateSubCommand3_Click()su
3、m=Text1.TextText1.Text=""k="-"EndSubPrivateSubCommand4_Click()sum=Text1.TextText1.Text=""k="*"EndSubPrivateSubCommand5_Click()sum=Text1.TextText1.Text=""k="/"EndSubPrivateSubCommand6_Click()DimaAsDoublea=Text1.TextIfk="+"Thensum=sum+aText1.Text=sumElseIfk=
4、"-"Thensum=sum-aText1.Text=sumElseIfk="*"Thensum=sum*aText1.Text=sumElseIfk="/"Thensum=sum/aText1.Text=sumEndIfEndSubPrivateSubCommand7_Click()UnloadForm1EndSubPrivateSubCommand8_Click()Text1.Text=""EndSub
此文档下载收益归作者所有