Deklarace Událostí

EVENT Name ( [ Parameter #1 [ , Parameter #2 ... ] )

This declares a Třída Události. This Události is raised by using the RAISE keyword.

The RAISE keyword may return a boolean value to indicate if the Události handler wants to cancel the Události.

Examples

EVENT BeforeSend(Data AS String) AS Boolean

...

DIM bResult AS Boolean

' Raises the event

bResult = RAISE BeforeSend("MyData")

IF bResult THEN
  PRINT "Canceled !"
ENDIF

Event Handler

By default, Name_EventName is the name of the Metody called in the Události listener when an Události is raised.

For example, if you have a Třída called FancyButton and you throw an Události called FancyClick, and if in your form called FMain you have a FancyButton objekt named MyButton, the Události handler Metody would look like this:

PUBLIC SUB MyButton_FancyClick(...)

The default behavior can be changed somewhat: see Object.Attach and other methods of the static Object Třída, as well as control groups whose information is applicable to any event-raising Třída.

Viz také