Returns the address of the given event handler, or defines a lambda expression.
Sub ( [ parameter_list ] ) expression
Sub [ ( [ parameter_list ] ) ] [ statements ] End [ Sub ]
- The name of an event handler.
- Mandatory in the expression construct.
- Optional in the block construct.
- Zero or more declarators with a comma between each, all between parentheses.
- Mandatory expression. The type of the expression is the return type of the procedure.
- Optional one or more executable statements.
- Completes the expression.
You can also use
End Sub. You can make one of these mandatory with the directive
@Option End. See @Option Directive for more information.
procedure_name must have the clause
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.
Event MouseEvent(x As Int32, y As Int32, btn As MouseButtons) win.OnClick = Sub ClickHandler Sub ClickHandler Handles MouseEvent ' ... End Sub