Sub Operator

Returns the address of the given event handler.

Syntax

Sub event_handler

Parts

event_handler
The name of an event handler.

Instructions

The procedure event_handler must have the clause Handles. You use an element of the event type to store the address returned by Sub. The element can be a variable or procedure parameter, or a value returned by a function or property.

Examples

Event MouseEvent(x As Int, y As Int, btn As MouseButtons)

#win.OnClick = Sub ClickHandler

Sub ClickHandler Handles MouseEvent
    ' ...
End Sub

See also