參考
--
--
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = "{開始1} : " + Now.Second.ToString + vbCrLf
delay(5)
TextBox1.Text += "{執行1} : " + Now.Second.ToString + vbCrLf
End Sub
Sub delay(ByVal t As Integer)
Dim Start As Integer = Environment.TickCount()
Dim TimeLast As Integer = t * 1000 ' 要延遲 t 秒,就設為 t *1000
Do
If Environment.TickCount() - Start > TimeLast Then Exit Do
Application.DoEvents()
Loop
End Sub
End Class
沒有留言:
張貼留言