STOP EVENT

STOP EVENT

This statement must be used in an event handler. It tells the interpreter that the event that called the event handler must be cancelled.

You can also cancel an event by returning TRUE in the event handler. But this statement is clearer.

Note: Only a few events can be cancelled. This is primarily intended to allow you to supersede default keyboard and mouse behavior with your own.


Example

' My text box only accepts digits

PUBLIC SUB MyTextBox_KeyPress()

  IF Instr("0123456789", Key.Text) = 0 THEN
    STOP EVENT
  ENDIF

END SUB