Example:
1. Add event to an object
Public Class Form1
Dim Obj As New Class1
' Associate an event handler with an event
AddHandler Obj.myEvent, AddressOf EvHandler
Obj.Class1Event()
End Sub
Sub EvHandler()
' Handle the eventMsgBox("EvHandler")
End Sub
Public Class Class1
Public Event myEvent()
Public Sub Class1Event()
RaiseEvent myEvent()
End Sub
End Class
End Class
Niciun comentariu:
Trimiteți un comentariu