Home > Language Reference > Classes > Object

Recipient Property

Recipient of events sent by the object.

Syntax

Public Property Get Recipient() As Object
Public Property Set Recipient(ByRef
objRecipient As Object)

ParameterDescription
objRecipientObject Reference.

Remarks

Each instance of an object contains a Recipient property that tells the system where to send events raised by the object. It is via this mechanism that controls on a form, for example, send events to the form on which they reside and not to another form.

When a class is instantiated, this property is set by default to Nothing, in other words events raised by this object are lost. On the other hand, if the class is instantiated at the time of its declaration by another class, this property receives a reference to this last class. The following example illustrates this :

Private t1 as New Timer ' t1.Recipient is initialized as Me
Private t2 as Timer

Private Sub Form_Load()
  Set t2 = New Timer ' t2.Recipient is initialized as Nothing
End Sub

Private Sub t1_Timer()
  ' OK
End Sub

Private Sub t2_Timer()
  ' Never Called
End Sub

In this example, the member variables t1 and t2 both receive an instance of the Timer object. At the same time, only the Recipient property of t1 is correctly initialized so that the form receives events raised by the timer.

For futher information on events, you should refer to the RaiseEvent documentation.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A