资源描述:
《在vb中制作单独程序封面的两种方法(two methods of making separate program covers in vb)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、在vb中制作单独程序封面的两种方法(TwomethodsofmakingseparateprogramcoversinVB)TwomethodsofmakingseparateprogramcoversinVBLiaoning,Tieling,JinYongtaoTheso-called"separatecover"hereisawindowoftheindependentapplicationwindowitself,whichisintheprocessInordertorun,thescreenfirstpopsuptodecoratetheprogramitself,ors
2、implydemonstratestheadvantagesoftheprogram.thisThekindofcoverexistsinmanyprofessionalWINDOWSprograms,andtherearetwosimplewaystoimplementthisinVBOnefunction.Thefirstmethod:multiformprogrammingmethodThismethodisacommonlyusedmethodthatcreatestwoormoreFormformsinaprogram,andputsthemintheformoftwoO
3、neofthemisaspecialsiteformakingaprogramcover:1,createanewproject,Form1,andplacetheCommand1commandbuttoninthisform,atCommand1-Click()eventinputendprogramcode"END"".2,clicktheInsertiteminthemenuandaddanewform,Form1.3,double-clicktheForm1formblank,andenterthefollowingcodeintheForm1-Load()eventtoh
4、idethemasterFormForm1,placethesecondformasthemaximummode,andruntheprogramfirsttodisplayandthetwoform:PrivateSubForm-Load()hidesthemainwindowForm1.Visible=0window2maximummodeForm2.WindowState=2'displaywindow2Form2.ShowEndSub4,definetheentirevariableintheformForm2:Dimstrr1AsStringDimIAsInteger5p
5、laceatimecontrolForm2intheformTimer1.6,enterthefollowingcodeintheForm-Load()eventinformForm2fordisplayinform2Image,juxtapositiontime,controlfrequency:Private,Sub,Form-Load()Form2.Picture=LoadPicture("c:windowssetup.bmp")Timer1.Interval=10I=0EndSub7,inthetimecontrolTimer1-Timer1()eventforthep
6、rogramcoverwork,demoJaneSingleanimation,andcontroltheanimationafterrunningforsometimeautomaticallystop,closetheprogramcover,returntothemainwindowThefollowingcodeimplementsarandomdisplayofstringsonapictureandautomaticallyexitsafterdisplayingthe30string.Private,Sub,Timer1-Timer()Strr1="programco
7、verdemo""WithForm2.Font.Transparent=Truetransparentdisplaycharacters.Font.Size=Rnd,*30+10'randomchangefontsize.Font.Italic=True'Italicisvalid.ForeColor=RGB(Rnd*256,Rnd*256,Rnd*256)randomchangeprospects.FontName=Screen.Fonts(Rnd*7+14)ran