欢迎来到天天文库
浏览记录
ID:12007593
大小:107.50 KB
页数:17页
时间:2018-07-15
《2010级《计算机基础实验(vb)》期末考试代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、1、PrivateSubCommand1_Click()a=Label1.Captionb=aLabel1.Caption=Text1.TextText1.Text=bEndSubPrivateSubForm_Load()Command1.Caption="修改"Label1.Caption="标签框"Text1.Text="文本框"EndSub2、PrivateSubCommand1_Click()a=Val(Text1.Text)b=Val(Text2.Text)x=-b/aText3.Text=xEndSubP
2、rivateSubCommand2_Click()Text1.Text=""Text2.Text=""Text3.Text=""EndSub3、PrivateSubForm_Load()a="此项操作正确吗?"b=MsgBox(a,36,"考试")Ifb=vbYesThenMsgBox"结果正确",,"考试"EndElsec=MsgBox("重新操作",48,"考试")Ifc=vbOKThenb=MsgBox(a,36,"考试")EndIfEndSub4、PrivateSubCommand1_Click()Comma
3、nd1.Caption=Text1.TextLabel1.Caption=Text1.TextEndSub5、PrivateSubCommand1_Click()Text4.Text=Val(Text1.Text)*Val(Text2.Text)*Val(Text3.Text)EndSubPrivateSubCommand2_Click()Text1.Text=""Text2.Text=""Text3.Text=""Text4.Text=""EndSub6、PrivateSubCommand1_Click()a=UC
4、ase(Text1.Text)'大写Text1.Text=aEndSubPrivateSubCommand2_Click()b=LCase(Text1.Text)'小写Text1.Text=bEndSubPrivateSubCommand3_Click()EndEndSub7、PrivateSubForm_Click()DimiAsInteger,sumAsIntegersum=0Fori=100To200If((iMod2)=1)And((iMod3)<>0)ThenPrintisum=sum+iEndIfNext
5、iPrintsumEndSub8、PrivateSubForm_Click()DimsAsLongDimnAsIntegers=1n=1Whiles<=400000n=n+1s=s*nWendPrintn-1EndSub9、窗口1PrivateSubForm_click()Form1.Visible=FalseForm2.ShowEndSub窗口2PrivateSubCommand1_Click()EndEndSubPrivateSubForm_click()Form1.Visible=TrueEndSub10Pri
6、vateSubForm_click()DimiAsInteger,jAsIntegerMe.AutoRedraw=TruePrintTab(20);"九九乘法表"PrintPrint"";Fori=1To9PrintTab(i*5);i;NextPrintFori=1To9Printi;Forj=1ToiPrintTab(j*5);i*j;NextjPrintNextiEndSub难度:中(11--20)11.PrivateSubCommand1_Click()IfOption1.ValueThenText1.Fon
7、tName="宋体"IfOption2.ValueThenText1.FontName="黑体"IfOption3.ValueThenText1.FontSize=8IfOption4.ValueThenText1.FontSize=14EndSubPrivateSubCommand2_Click()EndEndSub12、OptionExplicitPrivateSubCommand1_Click()IfList1.Selected(0)ThenText1.Text="A地"EndIfIfList1.Selecte
8、d(1)ThenText1.Text="B地"EndIfIfList1.Selected(2)ThenText1.Text="C地"EndIfIfList1.Selected(3)ThenText1.Text="D地"EndIfIfList1.Selected(4)ThenText1.Text="E地"EndIfIfList1.Selected
此文档下载收益归作者所有