아래와 같은 방법으로

1초에 한번씩 메세지를 띄울수 있습니다.

 

컨트롤 : 텍스트박스, 라벨, 타이머 (각1)

 

 

Public Class Form1
    Dim cnt As Integer = 1
    Dim tmpStr As String

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If cnt <= 5 Then
            tmpStr = tmpStr & Now & " TEST:" & cnt & vbCrLf
            cnt = cnt + 1
            TextBox1.Text = CInt(TextBox1.Text) - 1

        Else
            Timer1.Stop()
            MsgBox(tmpStr)
            End

        End If

    End Sub

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 1000
        Timer1.Start()
        TextBox1.Text = 5
    End Sub
End Class

 

+ Recent posts