欢迎来到天天文库
浏览记录
ID:2264970
大小:174.50 KB
页数:37页
时间:2017-11-15
《vb程序设计教程(第3版)课后实验答案》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、实验AA.1PrivateSubCommand1_Click()Label3=Text1EndSubA.2PrivateSubForm_Load()Timer1.Interval=0EndSubPrivateSubCommand1_Click()'自动Timer1.Interval=200EndSubPrivateSubCommand2_Click()'手动Timer1.Interval=0CallMyMoveEndSubPrivateSubTimer1_Timer()CallMyMoveEndSubS
2、ubMyMove()Label1.MoveLabel1.Left-50IfLabel1.Left<0ThenLabel1.Left=Form1.WidthEndSubA.3PrivateSubForm_Click()Text1=Val(Text1)+1EndSubPrivateSubForm_Load()Text1=0EndSubA.4PrivateSubForm_Click()Caption="单击窗体,改变图片"Picture=LoadPicture(App.Path+"_015.bmp")Pr
3、int"欢迎使用VB"EndSubPrivateSubForm_DblClick()ClsCaption="双击窗体,卸去图片"Picture=LoadPicture("")'EndSubPrivateSubForm_Load()Caption="装入窗体"Picture=LoadPicture(App.Path+"_016.bmp")Print"装入图"EndSubPrivateSubForm_Resize()'该事件的作用窗体始终与图一样大'Caption="窗体大小不变"'Form1.Widt
4、h=260*16'260是Tongji-2.bmp图的宽度,象素单位'Form1.Height=260*16+200'260是图的高度,象素单位,200是窗体的标题栏高度EndSubA.5SubCommand1_Click()Text1.FontName="隶书"Text1.FontSize=25EndSubSubCommand2_Click()Text2.Text=Text1.SelTextText2.FontName=Text1.FontNameText2.FontSize=Text1.FontSi
5、zeEndSub实验BB.1PrivateSubCommand1_Click()Text2=Format(5/9*(Val(Text1)-32),"0.00")EndSubPrivateSubCommand2_Click()Text1=Format(9/5*Val(Text2)+32,"0.00")EndSub或PrivateSubCommand1_Click()Dimf!,c!'声明两个变量f=Val(Text1)c=5/9*(f-32)Text2=Format(c,"0.00")'保留两位小数End
6、SubPrivateSubCommand2_Click()Dimff!,cc!'声明两个变量cc=Val(Text2)ff=9/5*cc+32Text1=Format(ff,"0.00")'保留两位小数EndSubB.2PrivateSubCommand1_Click()Label2=Format(Val(Text1)*Val(Text1)*3.14,"0.00")EndSubPrivateSubCommand2_Click()Label3=Format(Val(Text1)*3.14*2,"0.00"
7、)EndSubPrivateSubText1_LostFocus()IfNotIsNumeric(Text1.Text)ThenMsgBox"输入有非数字字符,请重新输入",,"警告"Text1.Text=""Text1.SetFocusEndIfEndSub或PrivateSubCommand1_Click()Label2=Format(Val(Text1)*Val(Text1)*3.14,"0.00")EndSubPrivateSubCommand2_Click()Label3=Format(Val
8、(Text1)*3.14*2,"0.00")EndSubPrivateSubText1_KeyPress(KeyAsciiAsInteger)IfKeyAscii=13ThenIfNotIsNumeric(Text1.Text)ThenText1.Text=""EndIfEndIfEndSubB.3PrivateSubCommand1_Click()n=Int(Log(2)/Log(1.008)+1)Label1=n&"年后人数超过26亿"
此文档下载收益归作者所有