[.NET] 問個delay的問題

看板Visual_Basic作者 (豬排症候群)時間18年前 (2007/10/05 18:52), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick time_ = time_ - 1 End Sub Public Function delay_(ByVal dur_ As Integer) As Integer time_ = dur_ Timer1.Interval = 100 'dur_ Timer1.Start() 'Timer1.Enabled = True While time_ > 0 End While Timer1.Stop() 'time_ = 0 End Function 想要做一個delay的function那 我在push bottom可以做但在這裡做成function後卻不能夠做 問問看有什麼方法可以做? thanks~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 202.39.18.50

10/05 23:32, , 1F
thread.threading.sleep(1000) → 停 1 秒
10/05 23:32, 1F
文章代碼(AID): #171XUAFh (Visual_Basic)