VB6 timer 點用~

2008-06-01 7:26 am
未學過~但要用!
1. 請詳細解釋 timer 既用途。
2. 求程式碼(詳細解釋+用途例子)吾要網上D教學網~
最重要第3(答到就得~)
*3. 整賽車GAME 可以點用timer?
吾識令到D車自己去終點(由左去右),
盡量吾越過終點(條線)
可能因為 timer 吾識用,所以...
想要程式碼~(WORK)
VB天才~吾該你地!

回答 (1)

2008-06-03 12:27 pm
✔ 最佳答案
Timer 係一個 control,加上 form 後是看不到的。

Timer 有個 interval 屬性,單位是 millisecond 千分一秒,1000 即一秒,60000 即一分鍾。

Timer 有一 個 Timer event,如果 interval 是 1000,Timer event 內的程式便每秒執行一次。

Timer 有另一個屬性 Enabled,Enabled 是 False 的話 Timer event 便不會執行,Enabled 是 True 才執行Timer event 內的程式。

你要整賽車便要用Timer 來移動 picture
e.g.
PictureBox1.Left = PictureBox1.Left + 200


到終點停車
If PictureBox1.Left < 500 Then
Timer1.Enabled = False
End If


收錄日期: 2021-04-25 20:32:35
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080531000051KK03320

檢視 Wayback Machine 備份