俄羅斯方塊VB實(shí)習(xí)報(bào)告_第1頁(yè)
俄羅斯方塊VB實(shí)習(xí)報(bào)告_第2頁(yè)
俄羅斯方塊VB實(shí)習(xí)報(bào)告_第3頁(yè)
俄羅斯方塊VB實(shí)習(xí)報(bào)告_第4頁(yè)
俄羅斯方塊VB實(shí)習(xí)報(bào)告_第5頁(yè)
已閱讀5頁(yè),還剩24頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

PAGEPAGE24課程名稱:VB.NET應(yīng)用開(kāi)發(fā)題目:變色俄羅斯方塊我的團(tuán)隊(duì):***姓名:***學(xué)號(hào):1004******1.系統(tǒng)設(shè)計(jì)說(shuō)明。“1:變色”俄羅斯方塊其最大的特點(diǎn)是在游戲運(yùn)行過(guò)程中能變換由20*20組合起來(lái)的方塊組。每種形狀對(duì)應(yīng)的顏色各不相同。當(dāng)方塊組在界面中下落時(shí),顯示的是它本身的顏色,當(dāng)落到底框下面時(shí),則自動(dòng)停止或消除同一行連續(xù)的方塊,同時(shí)變化成粉色。2:游戲界面清新亮麗,整個(gè)游戲共設(shè)置了5+4個(gè)功能鍵,其中五個(gè)BUTTON所對(duì)應(yīng)的分別是:開(kāi)始,恢復(fù),停止,退出以及當(dāng)前時(shí)間。停止,開(kāi)始,恢復(fù)都通過(guò)Me.Timer1來(lái)控制運(yùn)行,當(dāng)前時(shí)間可以查看游戲運(yùn)行過(guò)程中的各個(gè)準(zhǔn)確的時(shí)間點(diǎn)。由四個(gè)鍵盤控制的WASD中,通過(guò)鍵盤控制能很好的實(shí)現(xiàn)方塊的移動(dòng),變換和加速下落等過(guò)程。3:利用show()等相關(guān)函數(shù)實(shí)現(xiàn)方塊的實(shí)際運(yùn)行功能。在編寫代碼的過(guò)程中,我參考了一些比較好的控件的使用方法。不斷的添加進(jìn)俄羅斯方塊中。利用數(shù)組來(lái)實(shí)現(xiàn)小方塊的排列組合等功能。2.游戲代碼PublicClassForm1Dimt$DimNowDateAsDateDimAAsInteger=20'一個(gè)小方塊的長(zhǎng)和寬Dimf()Asfangkuai'表示小方塊的個(gè)數(shù)Dimx,yAsInteger'方塊對(duì)于面板的坐標(biāo)DimpanAsInteger=2'從開(kāi)始所轉(zhuǎn)到的位置,比如說(shuō),正7為1逆時(shí)針轉(zhuǎn)一個(gè)則為2DimbiaozhiAsInteger=1'方塊上次的位置DimnowlocationAsInteger'此時(shí)轉(zhuǎn)到的位置Dimshuzu()Asfangkuai'四個(gè)小方塊組合的一個(gè)大控件的數(shù)組DimshumuAsInteger=0''四個(gè)小方塊組合的一個(gè)大控件的數(shù)目DimabcAsIntegerDimss(360)AsIntegerDimgeshuAsInteger=0DimbbbAsInteger=0PrivateSubForm1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.LoadReDimshuzu(800)Forabc=0To800shuzu(abc)=NewfangkuaiNextMe.KeyPreview=TrueMe.Timer1.Enabled=TrueMe.Timer1.Interval=20tiaoxuan()Forabc=0To3shuzu(shumu)=f(abc)shumu=shumu+1NextEndSub'表示反7的控件PublicSubfanqi()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.VioletMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0fanqixing1()EndSubSubfanqisetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubfanqixing1()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x,y+2*A)EndSubSubfanqixing2()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+2*A,y+A)EndSubSubfanqixing3()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x+A,y+A)f(2).Location=NewPoint(x,y+2*A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubfanqixing4()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+2*A,y)f(3).Location=NewPoint(x+2*A,y+A)EndSubSubfanqixuanzhuan()Ifpan=1Thenfanqixing1()pan=2biaozhi=1ElseIfpan=2Thenfanqixing2()pan=3biaozhi=2ElseIfpan=3Thenfanqixing3()pan=4biaozhi=3ElseIfpan=4Thenfanqixing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctionfanqibiao()AsIntegerReturnbiaozhiEndFunction'表示正7的控件PublicSubzhenqi()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.DarkOrchidMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0zhenqixing1()EndSubSubzhenqisetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubzhenqixing1()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubzhenqixing2()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+2*A,y)f(3).Location=NewPoint(x,y+A)EndSubSubzhenqixing3()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x,y+2*A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubzhenqixing4()f(0).Location=NewPoint(x,y+A)f(1).Location=NewPoint(x+A,y+A)f(2).Location=NewPoint(x+2*A,y+A)f(3).Location=NewPoint(x+2*A,y)EndSubSubzhenqixuanzhuan()Ifpan=1Thenzhenqixing1()pan=2biaozhi=1ElseIfpan=2Thenzhenqixing2()pan=3biaozhi=2ElseIfpan=3Thenzhenqixing3()pan=4biaozhi=3ElseIfpan=4Thenzhenqixing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctionzhenqibiao()AsIntegerReturnbiaozhiEndFunction'表示像鴨子一樣的控件PublicSubzhenqiang()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.FirebrickMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0zhenqiangxing1()EndSubSubzhenqiangsetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubzhenqiangxing1()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x+2*A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x+A,y+A)EndSubSubzhenqiangxing2()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubzhenqiangxing3()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x+2*A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x+A,y+A)EndSubSubzhenqiangxing4()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubzhenqiangxuanzhuan()Ifpan=1Thenzhenqiangxing1()pan=2biaozhi=1ElseIfpan=2Thenzhenqiangxing2()pan=3biaozhi=2ElseIfpan=3Thenzhenqiangxing3()pan=4biaozhi=3ElseIfpan=4Thenzhenqiangxing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctionzhenqiangbiao()AsIntegerReturnbiaozhiEndFunction'表示如同鴨子形狀的反過(guò)來(lái)的控件PublicSubfanqiang()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.HotPinkMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0fanqiangxing1()EndSubSubfanqiangsetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubfanqiangxing1()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+2*A,y+A)EndSubSubfanqiangxing2()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x,y+2*A)EndSubSubfanqiangxing3()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+2*A,y+A)EndSubSubfanqiangxing4()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x,y+2*A)EndSubSubfanqiangxuanzhuan()Ifpan=1Thenfanqiangxing1()pan=2biaozhi=1ElseIfpan=2Thenfanqiangxing2()pan=3biaozhi=2ElseIfpan=3Thenfanqiangxing3()pan=4biaozhi=3ElseIfpan=4Thenfanqiangxing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctionfanqiangbiao()AsIntegerReturnbiaozhiEndFunction'表示1字形的控件PublicSubchangxing()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.BlackMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0changxingxing1()EndSubSubchangxingsetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubchangxingxing1()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+2*A,y)f(3).Location=NewPoint(x+3*A,y)EndSubSubchangxingxing2()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x+A,y+A)f(2).Location=NewPoint(x+A,y+2*A)f(3).Location=NewPoint(x+A,y+3*A)EndSubSubchangxingxing3()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+2*A,y)f(3).Location=NewPoint(x+3*A,y)EndSubSubchangxingxing4()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x+A,y+A)f(2).Location=NewPoint(x+A,y+2*A)f(3).Location=NewPoint(x+A,y+3*A)EndSubSubchangxingxuanzhuan()Ifpan=1Thenchangxingxing1()pan=2biaozhi=1ElseIfpan=2Thenchangxingxing2()pan=3biaozhi=2ElseIfpan=3Thenchangxingxing3()pan=4biaozhi=3ElseIfpan=4Thenchangxingxing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctionchangxingbiao()AsIntegerReturnbiaozhiEndFunction'表示如同倒T的控件PublicSubdaoti()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.IvoryMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0daotixing1()EndSubSubdaotisetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubdaotixing1()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+2*A,y+A)EndSubSubdaotixing2()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x,y+A)f(2).Location=NewPoint(x+A,y+A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubdaotixing3()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x+2*A,y)f(3).Location=NewPoint(x+A,y+A)EndSubSubdaotixing4()f(0).Location=NewPoint(x+A,y)f(1).Location=NewPoint(x+A,y+A)f(2).Location=NewPoint(x+2*A,y+A)f(3).Location=NewPoint(x+A,y+2*A)EndSubSubdaotixuanzhuan()Ifpan=1Thendaotixing1()pan=2biaozhi=1ElseIfpan=2Thendaotixing2()pan=3biaozhi=2ElseIfpan=3Thendaotixing3()pan=4biaozhi=3ElseIfpan=4Thendaotixing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctiondaotibiao()AsIntegerReturnbiaozhiEndFunction'表示正方形的控件PublicSubzhengfang()ReDimf(3)DimiAsIntegerFori=0To3f(i)=Newfangkuaif(i).BackColor=Color.CyanMe.Panel1.Controls.Add(f(i))f(i).Show()Nextx=120y=0zhengfangxing1()EndSubSubzhengfangsetxy(ByValaAsInteger,ByValbAsInteger)x=ay=bEndSubSubzhengfangxing1()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x+A,y+A)EndSubSubzhengfangxing2()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x+A,y+A)EndSubSubzhengfangxing3()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x+A,y+A)EndSubSubzhengfangxing4()f(0).Location=NewPoint(x,y)f(1).Location=NewPoint(x+A,y)f(2).Location=NewPoint(x,y+A)f(3).Location=NewPoint(x+A,y+A)EndSubSubzhengfangxuanzhuan()Ifpan=1Thenzhengfangxing1()pan=2biaozhi=1ElseIfpan=2Thenzhengfangxing2()pan=3biaozhi=2ElseIfpan=3Thenzhengfangxing3()pan=4biaozhi=3ElseIfpan=4Thenzhengfangxing4()pan=1biaozhi=4ElseMsgBox("無(wú)效")EndIfEndSubFunctionzhengfangbiao()AsIntegerReturnbiaozhiEndFunction'以下表示選擇以上控件的代碼,隨機(jī)的Subtiaoxuan()DimnAsIntegerDimrAsRandomr=NewRandom()n=r.NextMod7+1nowlocation=nSelectCasenCase1fanqi()Case2zhenqi()Case3daoti()Case4zhenqiang()Case5fanqiang()Case6zhengfang()Case7changxing()EndSelectDebug.WriteLine(n)EndSubSubxuanzhuan()SelectCasenowlocationCase1fanqiangxuanzhuan()Case2zhenqixuanzhuan()Case3daotixuanzhuan()Case4zhenqiangxuanzhuan()Case5fanqiangxuanzhuan()Case6zhengfangxuanzhuan()Case7changxingxuanzhuan()EndSelectEndSubSubgetmax(ByRefxiaAsInteger,ByRefleftAsInteger,ByRefrightAsInteger)SelectCasenowlocationCase1SelectCasefanqibiao()Case1right=x+Axia=y+2*ACase2right=x+2*Axia=y+ACase3right=x+Axia=y+2*ACase4right=x+2*Axia=y+AEndSelectleft=xCase2SelectCasezhenqibiao()Case1right=x+Axia=y+2*ACase2right=x+2*Axia=y+ACase3right=x+Axia=y+2*ACase4right=x+2*Axia=y+AEndSelectleft=xCase3SelectCasedaotibiao()Case1right=x+2*Axia=y+Aleft=xCase2right=x+Axia=y+2*Aleft=xCase3right=x+2*Axia=y+Aleft=xCase4right=x+2*Axia=y+2*Aleft=x+AEndSelectCase4SelectCasezhenqiangbiao()Case1right=x+2*Axia=y+ACase2right=x+Axia=y+2*ACase3right=x+2*Axia=y+ACase4right=x+Axia=y+2*AEndSelectleft=xCase5SelectCasefanqiangbiao()Case1right=x+2*Axia=y+ACase2right=x+Axia=y+2*ACase3right=x+2*Axia=y+ACase4right=x+Axia=y+2*AEndSelectleft=xCase6SelectCasezhengfangbiao()Case1right=x+Axia=y+ACase2right=x+Axia=y+ACase3right=x+Axia=y+ACase4right=x+Axia=y+AEndSelectleft=xCase7SelectCasechangxingbiao()Case1right=x+3*Axia=yleft=xCase2right=x+Axia=y+3*Aleft=x+ACase3right=x+3*Axia=yleft=xCase4right=x+Axia=y+3*Aleft=x+AEndSelectEndSelectEndSubSubsetxy(ByValaAsInteger,ByValbAsInteger)SelectCasenowlocationCase1fanqisetxy(a,b)Case2zhenqisetxy(a,b)Case3daotisetxy(a,b)Case4zhenqiangsetxy(a,b)Case5fanqiangsetxy(a,b)Case6zhengfangsetxy(a,b)Case7changxingsetxy(a,b)EndSelectEndSubSubgetfuwei()SelectCasenowlocationCase1SelectCasefanqibiao()Case1fanqixing1()Case2fanqixing2()Case3fanqixing3()Case4fanqixing4()EndSelectCase2SelectCasezhenqibiao()Case1zhenqixing1()Case2zhenqixing2()Case3zhenqixing3()Case4zhenqixing4()EndSelectCase3SelectCasedaotibiao()Case1daotixing1()Case2daotixing2()Case3daotixing3()Case4daotixing4()EndSelectCase4SelectCasezhenqiangbiao()Case1zhenqiangxing1()Case2zhenqiangxing2()Case3zhenqiangxing3()Case4zhenqiangxing4()EndSelectCase5SelectCasefanqiangbiao()Case1fanqiangxing1()Case2fanqiangxing2()Case3fanqiangxing3()Case4fanqiangxing4()EndSelectCase6SelectCasezhengfangbiao()Case1zhengfangxing1()Case2zhengfangxing2()Case3zhengfangxing3()Case4zhengfangxing4()EndSelectCase7SelectCasechangxingbiao()Case1changxingxing1()Case2changxingxing2()Case3changxingxing3()Case4changxingxing4()EndSelectEndSelectEndSubSubgetfangkuai()EndSub'移動(dòng)時(shí)方塊不要碰撞PublicFunctionbupengzhuangleft(ByValxingAsfangkuai,ByValqiangAsfangkuai)AsBooleanDimx1,y1,x2,y2,x3,y3,m1,n1,m2,n2,m3,n3,m4,n4AsIntegerx1=xing.Location.X-5y1=xing.Location.Y+xing.Size.Height/4x2=xing.Location.X-5y2=xing.Location.Y+xing.Size.Height/2x3=xing.Location.X-5y3=xing.Location.Y+xing.Size.Heightm1=qiang.Location.Xn1=qiang.Location.Ym2=m1+qiang.Size.Widthn2=n1m3=m1n3=n1+qiang.Size.Heightm4=m2n4=n3If((x1>m1Andx1<m2Andy1>n1Andy1<n3)Or(x2>m1Andx2<m2Andy2>n1Andy2<n3)Or(x3>m1Andx3<m2Andy3>n1Andy3<n3))ThenReturnTrueEndIfEndFunctionPublicFunctionbupengzhuangright(ByValxingAsfangkuai,ByValqiangAsfangkuai)AsBooleanDimx1,y1,x2,y2,x3,y3,m1,n1,m2,n2,m3,n3,m4,n4AsIntegerx1=xing.Location.X+xing.Size.Width+5y1=xing.Location.Y+xing.Size.Height/4x2=xing.Location.X+xing.Size.Width+5y2=xing.Location.Y+xing.Size.Height/2x3=xing.Location.X+xing.Size.Width+5y3=xing.Location.Y+xing.Size.Heightm1=qiang.Location.Xn1=qiang.Location.Ym2=m1+qiang.Size.Widthn2=n1m3=m1n3=n1+qiang.Size.Heightm4=m2n4=n3If((x1>m1Andx1<m2Andy1>n1Andy1<n3)Or(x2>m1Andx2<m2Andy2>n1Andy2<n3)Or(x3>m1Andx3<m2Andy3>n1Andy3<n3))ThenReturnTrueEndIfEndFunctionPublicFunctionbupengzhuangxia(ByValxingAsfangkuai,ByValqiangAsfangkuai)AsBooleanDimx4,y4,m1,n1,m2,n2,m3,n3,m4,n4AsIntegerx4=xing.Location.X+xing.Size.Width/2y4=xing.Location.Y+xing.Size.Height+11m1=qiang.Location.Xn1=qiang.Location.Ym2=m1+qiang.Size.Widthn2=n1m3=m1n3=n1+qiang.Size.Heightm4=m2n4=n3If(x4>=m1Andx4<=m2Andy4>=n1Andy4<=n3)ThenReturnTrueEndIfEndFunctionPublicFunctionbupengzhuangxia1(ByValxingAsfangkuai,ByValqiangAsfangkuai)AsBooleanDimx4,y4,m1,n1,m2,n2,m3,n3,m4,n4AsIntegerx4=xing.Location.X+xing.Size.Width/2y4=xing.Location.Y+xing.Size.Heightm1=qiang.Location.Xn1=qiang.Location.Ym2=m1+qiang.Size.Widthn2=n1m3=m1n3=n1+qiang.Size.Heightm4=m2n4=n3If(x4>=m1Andx4<=m2Andy4>=n1Andy4<=n3)ThenReturnTrueEndIfEndFunctionFunctionbupengleft()AsBooleanDimsa,sbAsIntegerForsa=0Toshumu-1-4Forsb=0To3Ifbupengzhuangleft(f(sb),shuzu(sa))ThenReturnTrueEndIfNextNextEndFunctionFunctionbupengright()AsBooleanDimsa,sbAsIntegerForsa=0Toshumu-1-4Forsb=0To3Ifbupengzhuangright(f(sb),shuzu(sa))ThenReturnTrueEndIfNextNextEndFunctionFunctionbupengxia()AsBooleanDimsa,sbAsIntegerForsa=0Toshumu-1-4Forsb=0To3Ifbupengzhuangxia(f(sb),shuzu(sa))ThenReturnTrueEndIfNextNextEndFunctionFunctionbupengxia1()AsBooleanDimsa,sbAsIntegerForsa=0Toshumu-1-4Forsb=0To3Ifbupengzhuangxia1(f(sb),shuzu(sa))ThenReturnTrueEndIfNextNextEndFunction'使方塊不出界PrivateFunctionbuchujie(ByValdiannaoAsfangkuai)AsBooleanDimx1,y1,x2,y2AsIntegerx1=diannao.Location.Xy1=diannao.Location.Yx2=x1+diannao.Size.Widthy2=y1+diannao.HeightIf(x1<0Orx2>Me.Panel1.Width)ThenElseIfy1<0ThenElseIfy2>=Me.Panel1.HeightThenReturnTrueEndIfEndFunctionFunctionbuchu()AsBooleanDimjAsIntegerForj=0To3Ifbuchujie(f(j))ThenReturnTrueEndIfNextReturnFalseEndFunctionPrivateFunctionchujie(ByValdiannaoAsfangkuai)AsBooleanDimx1,y1,x2,y2AsIntegerx1=diannao.Location.Xy1=diannao.Location.Yx2=x1+diannao.Size.Widthy2=y1+diannao.HeightIf(x1<0Orx2>Me.Panel1.WidthOry1<0Ory2>Me.Panel1.Height)ThenReturnTrueEndIfEndFunction'查找相同的一行Subxiangtong()Dimxin(14),shuAsIntegerDimsssAsInteger=0DimjishuAsInteger=0Forshu=460

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論