全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1523
推到 Plurk!
推到 Facebook!

有關Delay的方式

 
tailen
中階會員


發表:82
回覆:109
積分:63
註冊:2002-04-08

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-05-03 16:50:56 IP:61.218.xxx.xxx 未訂閱
各位先進好: 小弟有一疑問,是否有Delay()的函式嗎?我只是要讓程式暫停一下,再往下做!如:動畫或是歡迎畫面停留一段時間後再執行主程式!請問有何函式,要uses那個Unit?謝謝各位!
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-05-03 17:08:49 IP:211.22.xxx.xxx 未訂閱
用 Sleep 這個函式吧! 或參考 Delphi 的這篇 FAQ: Article #15830: Creating a delay without a timer. Question and Answer Database FAQ830D.txt Creating a delay without a timer. Category :Windows API Platform :All Product :All 32 bit Question: How do I create a delay without using a TTimer component, and without locking up the system? Answer: Here is an example of using a loop that checks the time and calls Application.ProcessMessages to allow Windows messages to be processed during the loops execution. procedure Delay(ms : longint); var TheTime : LongInt; begin TheTime := GetTickCount ms; while GetTickCount < TheTime do Application.ProcessMessages; end; procedure TForm1.Button1Click(Sender: TObject); begin ShowMessage('Start Test'); Delay(2000); ShowMessage('End Test'); end; 7/16/98 4:31:28 PM Last Modified: 01-SEP-99 發表人 - hagar 於 2002/05/03 17:09:41
系統時間:2024-03-28 23:33:31
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!