'Handles' is not valid on operator declaration

An Operator Statement specifies the Handles keyword.

Only a Sub procedure can handle events. An Operator procedure cannot. For more information on event handlers, see How to: Call an Event Handler in Visual Basic.

An Operator procedure requires both the Public and Shared keywords, and a conversion operator requires either the Widening or the Narrowing keyword. For more information, see Operator Procedures.

Error ID: BC33003

To correct this error

  • If you intend this procedure to handle events, rewrite it as a Sub procedure.

  • If you intend this procedure to define an operator, remove the Handles keyword from its declaration.

See Also

Tasks

How to: Define an Operator

How to: Define a Conversion Operator

Reference

Operator Statement