'Return' statement in an 'AddHandler', 'RemoveHandler', or 'RaiseEvent' method cannot return a value
The AddHandler, RemoveHandler, and RaiseEvent methods in a Custom Event declaration can contain Return statements to exit the methods. However, the Return statement cannot specify a return value because the methods cannot return values.
Error ID: BC30940
To correct this error
- Remove the expression following the Return statement.
See Also
Reference
Return Statement (Visual Basic)