表白程序VB源碼_第1頁
表白程序VB源碼_第2頁
表白程序VB源碼_第3頁
表白程序VB源碼_第4頁
表白程序VB源碼_第5頁
已閱讀5頁,還剩14頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Private Declare Function mciSendString Lib ,H Alias mciSendStringA (ByVai IpstrCommand As String, By Vai IpstrReturnString As String, By Vai uReturnLength As Long, By Vai hwndCallback As Long) As Long mcisendstring 播放音樂的 API 函數(shù)Private Declare Function timeGetTime Lib () As Long 用于制作延時函數(shù)Dim WithEvent

2、s imgMG As Image 申明控件數(shù)組Dim i As Integer全局變量Dim imgBox(999) As Image 記錄控件數(shù)組的數(shù)組Dim ratio As DoublePrivate Sub Form_Load()=0=2=0=0=20480 圖片框寬度等于屏幕寬度=115101ratio = /(-ratio / 2, l)-(ratio / 2, -1)=vbWhiteDrawLines 0, 0lmagel(0).Picture = LoadPicture & 紅玫瑰gif)=0=0= True=vbRed=Falserail BBEnd SubPrivate S

3、ub Label2_Click()mciSendString close movie, 0&, 0, 0Unload Me 退出程序End SubPrivate Sub BB()本程序主要的函數(shù),功能都在里實現(xiàn)Call MusicPIay1 播放音樂Forj = lTo99X = Rnd * 20480Y = Rnd * 11510i = i + lLoad Imagel(i)Imagel(i).Picture = Imagel(O).Picture lmagel(i).Width = lmagel(O).WidthImagel(i).Height = Imagel(O).Height lma

4、gel(i).Top = Y lmagel(i).Left = Xlmagel(i).Visible = TrueSleep2 200= i&送上99朵玫瑰,代表我的心!“Next j=”我們一起長長久久“隨機“畫”出99朵玫瑰 nullMeiGui i “察”去玫瑰清屏,下同_ miMeiGui,M你和你的名字在我心中”Sleep2 3000nullMeiGui i1畫出桃心_ miMeiGui,M=Nl LOVE UNSleep2 3000nullMeiGui i 畫出 i love u_ miMeiGui,M二喜歡嗎?Y = MsgBox(告訴我你喜歡嗎? “, vbYesNo, ”我想

5、知道“)If Y = vbYes ThennullMeiGui iMeiGui二你喜歡,我很開心Open & 丫 For Append As #1Print #lz 11 我喜歡,Close #1ElsenullMeiGui iMeiGui=“你不喜歡,我很難過“Open & 丫 For Append As #1Print #1,我不喜歡Close #1End If= True=vbRed點這里退出“=/2- /2End SubPrivate Sub MusicPlay()1 音樂播放函數(shù)mName= &獲取音樂文件地址及文件名,音樂文件放在當前文件夾卞,即為我去程序所在當前文件夾路徑mciS

6、endString Mclose movie, 0&, 0, 0mciSendString open & mName & TYPE MPEGVideo Alias movie, 0&, 0,0 1 注意 open 后有 個空格,TYPE前有個空格,否則播放不成功mciSendString play movie repeat11, 0&, 0, 0mciSendString play movie11, 0&, 0, 0End SubPrivate Sub MeiGuifByVal strFile As String)用玫瑰繪制想要寫的字或圖片,文件是事先做好的, 可以通過代碼下面的代碼完成Ope

7、n & ,1 & strFile For Input As #1While Not EOF(l)Sleep2 (200)Input #lz X, Yi = i + lLoad Imagel(i)Imagel(i).Picture = lmagel(0).Picturelmagel(i).Width = lmagel(0).WidthImagel(i).Height = lmagel(0).Heightlmagel(i).Top = Y - lmagel(0).Height / 2lmagel(i).Left = X - lmagel(0).Width / 2lmagel(i).Visible

8、= TrueWendClose #1End SubPrivate Sub nullMeiGui(ByVal N As Integer)通過釋放控件數(shù)組清屏For j = N To 1 Step -1Sleep2 (200)Unload Imagel(j)Next ji = 0End SubPrivate Function Sleep2(T As Long)延時函數(shù)Dim Savetime As LongSavetime =timeGetTime 記下開始時的時間,以亳秒為單位While timeGetTime Savetime + T 循壞等待DoEvents,轉讓控制權WendEnd Fun

9、ctionPrivate Sub Picturel_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)用 點描記出要繪制的圖畫或文字,記錄的數(shù)據(jù)保存在,復制出去可用=0=vbRed(Xz Y), vbRedOpen & V1 For Append As #1Print #1, X & ”f,“, ”,”, Y & “f,“;記錄點擊的位置Close #1End SubPrivate Sub DrawLines(ByVal X As Long, By Vai Y As Long)畫網(wǎng)格,描記圖形時用=0

10、=vbRed(0,1)-(0, -1)(-ratio / 2, 0)-(ratio / 2, 0)End Sub程序中用到的圖片資源:紅玫瑰gif 文件記錄的數(shù)據(jù)157522951530345015754590151557751485688514708025388523103855346539004590384057603840690037657995456080405610799570653045601540655865534060156420667573207140759077557080816061658160499576653840853528508805376590904980931

11、5598595556870100507485107556660112205595114304515116853525118502730125252685131702685142052685124053735124204875124505820124206780123907545134107500144757590131255040139354995160802685160653810162155010165606090171457200179707260184806345186605175189003930189303195190052625其他文件數(shù)據(jù)附于文末 運行時截圖:OVEmL程序運行

12、是動態(tài)的,這是瞬間截圖 數(shù)據(jù)8160 7140 6195 5655 5505 5685 6120 6945 7680 8460 9270 10065 10935 11520 12135 12615 12960 13020 12885 12345 11655 10800 9960 9435 7605 6555 5820 5565 5565 5895 6465 7290 8070 8895 9720 10500 11205 11775 12330 12840 8580 7725 751588353300289524902610331543055460646573808145862589108580

13、804074106525559544253540268521302115237027453030264025202955379549356030684077558355873086858235768068556015502546504140526569906975624065557230801085508100796569306255630066157080724576056885766581757530822083858925892588058580904595559690102759945948010665107401123510035958588808475859590759030976

14、545453825426033003210351039005625477051304905540060155670658560306345714078007620657072906735738078908250829578158265786074857185712575007080699064956150595552505235553558655400970597059075907595409600101251012510245976510740107401140011850122401201511295113701083010710112951200011865123751248010170

15、103651135511145109501050010050103201084511190108001161011250107251152011250124351288512330478545303930397534503180384043654275322527902820267028053285327038103840429042304170373537053210496554605520517556556000612065706300669066456390609048754770466541553960477046501200011895124501197011700118051219

16、5數(shù)據(jù)148523253210414052203240315030752100421516352715408018302790373538701710169525953810192033904501515274539605295130520703270331511551170217533605130526554905730603056852265231022952340234014102895358530453120405041104215468047554710552053856015613562406870694578007785780078007770847585058520939091

17、80984099001002036153645361543355325628567954590613530004035483040053990399039154725448552956015678074405895654072302655348043352640259535404335432025652625253525203630459052053480441053256045640572908400810071556570616567807740937589858685975010770115801243512045102009750927088058295102301069511160138451384513845147451546515525154951462516410172501810518630183601792517610169501663516095154956015595558956765768084159120859573357290727572302985234020552310363058354800649576358475828073204080385539604410447041253885415547706210667570056885639060904785286520401680017

溫馨提示

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

評論

0/150

提交評論