summaryrefslogtreecommitdiff
path: root/tests/examplefiles/vbnet_test.bas
blob: af5f25740f49aa44c856f7623aeeacf68aedb386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Public Class Form1
    Inherits System.Windows.Forms.Form

    Private t As New System.Timers.Timer(2000)

    Private Sub Form1_Load(ByVal sender As Object, _
          ByVal e As System.EventArgs) Handles MyBase.Load
        
        AddHandler t.Elapsed, AddressOf TimerFired
    End Sub

    Private Sub btnStart_Click(ByVal sender As System.Object, _ 
          ByVal e As System.EventArgs) Handles btnStart.Click
          
        t.Enabled = True
    End Sub

    Private Sub btnStop_Click(ByVal sender As System.Object, _
          ByVal e As System.EventArgs) Handles btnStop.Click
          
        t.Enabled = False
    End Sub

    Public Sub TimerFired(ByVal sender As Object, _ 
           ByVal e As System.Timers.ElapsedEventArgs)
           
        Label1.Text = "Signal Time = " & e.SignalTime.ToString
    End Sub
End Class