RaiseEvent Instruction
Syntax RaiseEvent name[(arglist)]
Group Flow Control
Description Raise an Event. Evaluate the arglist and call name with those values.
See Also Event, WithEvents.
Example
'Class1.cls
'#Language
"WWB-COM"
Event Changing(ByVal OldValue As String, ByVal
NewValue As String)
Private Value_ As
String
Property Get Value As
String
Value = Value_
EndProperty
Property Let Value(ByVal NewValue As
String)
RaiseEvent Changing(Value_,
NewValue)
Value_ = NewValue
EndProperty
'Macro.bas
'#Uses "Class1.cls"
'#Language
"WWB-COM"
Dim WithEvents c1 As Class1
SubMain
Set c1 = New
Class1
c1.Value = "Hello"
c1.Value =
"Goodbye"
End Sub
Sub c1_Changing(ByVal OldValue
As String, ByVal NewValue As String)
Debug.Print "OldValue=""" & OldValue & """, NewValue="""
& NewValue & """"
End Sub