Adding a Callback Event Handler in VB.NET
June 29, 2010
in Uncategorized
- Dim “WithEvents”
Dim WithEvents ftp As Chilkat.Ftp2
- Add some code to create a new instance of the object.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ftp = New Chilkat.Ftp2()
ftp.EnableEvents = True
ftp.HeartbeatMs = 100
...
- Select the “ftp” object.

- Select the event. This causes Visual Studio to generate the event handler function.

- Add your application code to the event handler function.
Private Sub ftp_OnAbortCheck(ByVal sender As Object, ByVal args As Chilkat.AbortCheckEventArgs) Handles ftp.OnAbortCheck
' Add your application code here...
End Sub