Event Definition

Syntax                  [ | Public ] _
Event name[([param[, ...]])]

Group                   Declaration

Description           User defined event. The event defines a sub that can be defined using WithEvents.. The values of the calling arglist are assigned to the params. 

Access                  If no access is specified then Public is assumed.

See Also               RaiseEvent.

Example               ' Class1
'#Language "WWB.NET"
Event Changing(ByVal OldValue As String, ByVal NewValue As String)

Private Value_ As String

PropertyGet Value As String
    Value = Value_
EndProperty

PropertyLet Value(ByVal NewValue As String)
    RaiseEvent Changing(Value_, NewValue)
    Value_ = NewValue
EndProperty

'#Uses "Class1.cls"

DimWithEvents c1 As Class1

SubMain
    c1 = New Class1
    c1.Value = "Hello"
    c1.Value = "Goodbye"
EndSub

Sub c1_Changing(ByVal OldValue As String, ByVal NewValue As String) Handles c1.Changing
    Debug.Print "OldValue=""" & OldValue & """, NewValue=""" & NewValue & """"
EndSub