下载
加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 VB程序代码

VB程序代码.doc

VB程序代码

尒先玍
2017-09-27 0人阅读 举报 0 0 暂无简介

简介:本文档为《VB程序代码doc》,可适用于综合领域

VB程序代码、调用多个应用程序OptionExplicitDimiAsIntegerPrivateSubCommandClick()i=Shell("C:WINDOWSsystemcalcexe")EndSubPrivateSubCommandClick()i=Shell("C:WINDOWSsystemmspaintexe",)EndSubPrivateSubCommandClick()i=Shell("C:ProgramFilesMicrosoftOfficeOFFICEWINWORDEXE",)EndSubPrivateSubCommandClick()i=Shell("C:ProgramFilesMicrosoftOfficeOFFICEEXCELEXE",)EndSubPrivateSubCommandClick()i=Shell("C:ProgramFilesMicrosoftOfficeOFFICEPOWERPNTEXE",)EndSub、圆的计算和字体缩放PrivateSubCommandClick()Text=""Text=""Text=""EndSubPrivateSubCommandClick()Text=**Val(Text)Text=*Val(Text)^EndSubPrivateSubCommandClick()TextFontSize=TextFontSizeTextFontSize=TextFontSizeTextFontSize=TextFontSizeEndSubPrivateSubCommandClick()TextFontSize=TextFontSizeTextFontSize=TextFontSizeTextFontSize=TextFontSizeEndSub、移动的图片PrivateSubCommandClick()TimerInterval=EndSubPrivateSubCommandClick()TimerInterval=EndSubPrivateSubTimerTimer()Dimzz=Int(Rnd*)ImageLeft=Int(Rnd*(FormLeftImageLeft))ImageTop=Int(Rnd*(FormTopImageTop))EndSub、随机三位数~并求其各个位置上的数字PrivateSubCommandClick()Dimx,yx=Val(Text):y=Val(Text)Text=Int(Rnd*(yx)x)EndSubPrivateSubCommandClick()Dima,b,c,ss=Val(Text)a=sb=(sa*)c=sa*b*Text=a:Text=b:Text=cEndSubPrivateSubCommandClick()Text=Left(Text,)Text=Mid(Text,,)Text=Right(Text,)EndSubPrivateSubCommandClick()Text="":Text="":Text=""EndSubPrivateSubCommandClick()EndEndSub、正向正三角形PrivateSubCommandClick()DimiFori=ToPrintTab(i)Forj=To*iPrint"*"NextjPrintNextiEndSub、倒向正三角形PrivateSubCommandClick()DimiFori=ToPrintTab(i)Forj=To*(i)Print"*"NextjPrintNextiEndSub、平行四边形PrivateSubCommandClick()DimiFori=ToPrintTab(i)Forj=ToPrint"*"NextjPrintNextiEndSub、菱形,方法,PrivateSubCommandClick()Dimi,jFori=ToIfi<=ThenPrintTab(i)Forj=To*iPrint"*"NextjElsePrintTab(i)Forj=To*(i)Print"*"NextjEndIfNextiEndSub、菱形,方法,PrivateSubCommandClick()Dimi,j,kFori=ToIfi<=ThenPrintTab(i)k=*iElsePrintTab(i)k=*(i)EndIfForj=TokPrint"*"NextjNextiEndSub、漏斗形,方法,PrivateSubCommandClick()Dimi,jFori=ToIfi<=ThenPrintTab(i)Forj=To*(i)Print"*"NextjElsePrintTab(i)Forj=To*(i)Print"*"NextjEndIfNextiEndSub、漏斗形,方法,PrivateSubCommandClick()Dimi,j,kFori=ToIfi<=ThenPrintTab(i)k=*(i)ElsePrintTab(i)k=*(i)EndIfForj=TokPrint"*"NextjNextiEndSub、数字正向三角形PrivateSubCommandClick()Dimi,jFori=ToPrintTab(i)Forj=ToiPrintTrim(i)""NextjPrintNextiEndSub、混合字符三角形PrivateSubCommandClick()Dimi,jFori=ToPrintTab(i)Forj=To*iIfiMod=ThenPrint"$"ElsePrint"*"EndIfNextjPrintNextiEndSub、字母顺序菱形PrivateSubCommandClick()Dimi,j,kFori=ToIfi<=ThenPrintTab(i)k=*iElsePrintTab(i)k=*(i)EndIfForj=TokPrintChr(j)NextjPrintNextiEndSub、回文数菱形PrivateSubCommandClick()Dimi,j,kFori=ToIfi<=ThenPrintTab(i)k=*iElsePrintTab(i)k=*(i)EndIfForj=TokIfj<=(k)ThenPrintTrim(j)ElsePrintTrim(kj)EndIfNextjPrintNextiEndSub、按矩阵形状输出PrivateSubCommandClick()Dima(To,To)AsInteger,sAsIntegers=Fori=ToForj=Toa(i,j)=ss=sPrinta(i,j)NextjPrintNextiEndSub、求矩阵所有元素之和PrivateSubCommandClick()Dima(To,To)AsInteger,sAsInteger,sumAsIntegers=Fori=ToForj=Toa(i,j)=ss=sPrinta(i,j)sum=suma(i,j)NextjPrintNextiPrint"矩阵所有元素之和为:"sumEndSub、求矩阵四周元素之和PrivateSubCommandClick()Dima(To,To)AsInteger,sAsInteger,sumAsIntegers=Fori=ToForj=Toa(i,j)=ss=sPrinta(i,j)Ifi=Ori=Orj=Orj=Thensum=suma(i,j)EndIfNextjPrintNextiPrint"矩阵四周元素之和为:"sumEndSub、求矩阵非四周元素之和PrivateSubCommandClick()Dima(To,To)AsInteger,sAsInteger,sumAsIntegers=Fori=ToForj=Toa(i,j)=ss=sPrinta(i,j)Ifi<>Andi<>Andj<>Andj<>Thensum=suma(i,j)EndIfNextjPrintNextiPrint"矩阵非四周元素之和为:"sumEndSub、求方阵主对角线元素之和PrivateSubCommandClick()Dima(To,To)AsInteger,sAsInteger,sumAsIntegerFori=ToForj=Toa(i,j)=Int(Rnd*)Printa(i,j)NextjPrintNextiFori=ToForj=ToIfi=jThensum=suma(i,j)EndIfNextjNextiPrint"方阵主对角线元素之和为:"sumEndSub、求方阵次对角线元素之和PrivateSubCommandClick()Dima(To,To)AsInteger,sAsInteger,sumAsIntegerFori=ToForj=Toa(i,j)=Int(Rnd*)Printa(i,j)NextjPrintNextiFori=ToForj=ToIfij=Thensum=suma(i,j)EndIfNextjNextiPrint"方阵次对角线元素之和为:"sumEndSub、求π值PrivateSubCommandClick()Dimi,t!,π!,s!i=:π=:t=DoUntilAbs(t)<i=it=()^(i)(*i)s=stLoopπ=s*Print"π="πEndSub、模拟随机掷骰子PrivateSubCommandClick()Dimn,n,n,n,n,n,nDimrn=Val(Text)Fori=Tonr=Int(Rnd*)Ifr=Thenn=nElseIfr=Thenn=nElseIfr=Thenn=nElseIfr=Thenn=nElseIfr=Thenn=nElsen=nEndIfNextiText=n:Text=nn*""Text=n:Text=nn*""Text=n:Text=nn*""Text=n:Text=nn*""Text=n:Text=nn*""Text=n:Text=nn*""EndSub、百钱买百鸡PrivateSubCommandClick()Dimi,j,kPrint"鸡翁个数","鸡母个数","鸡雏个数"Fori=ToForj=ToFork=ToIfi*j*k=Andijk=ThenPrinti,j,kEndIfNextkNextjNextiEndSub、阶梯多少阶方法一PrivateSubCommandClick()DimiDoWhileiMod<>OriMod<>OriMod<>OriMod<>OriMod<>i=iLoopPrint"阶梯至少有"i"阶"方法二PrivateSubCommandClick()DimiDoUntiliMod=AndiMod=AndiMod=AndiMod=AndiMod=i=iLoopPrint"阶梯至少有"i"阶"、销售收入翻两番PrivateSubCommandClick()Dimi,j!j=DoWhilej<=j=j*()i=iLoopPrint"需要"i"年可以翻两番"EndSub、多窗体密码对应显示PrivateSubCommandClick()FormShowFormPrint"用户名:"TextTextFormPrint"密码:"TextTextFormPrint"姓名:"TextTextIfOptionValue=TrueThenFormPrint"性别:"OptionCaptionElseIfOptionValue=tureThenFormPrint"性别:"OptionCaptionEndIfEndSub、单选按钮综合斐波那契数列Dimfib()AsLong,iAsInteger,nAsIntegerFori=ToIfOption(i)ValueThenn=Val(Option(i)Caption)EndIfNextiReDimfib(n)fib()=:fib()=Fori=Tonfib(i)=fib(i)fib(i)NextiText=fib(n)

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/18

VB程序代码

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利