Example 2
Associating an event handler, or delegate, with an event using the AddHandler
statement in VB.NET
Private Sub OnIdle(ByVal sender As Object, ByVal e As EventArgs) StatusBar1.Text = TimeString End Sub Private Sub Form1_Load(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles MyBase.Load AddHandler Application.Idle, AddressOf OnIdle End Sub