Home > lang > eventdecl 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Search  Administration  
Documentation  
Warning! This page is not translated.  See english version 
Events declaration
EVENT Name ( [ Parameter #1 [ , Parameter #2 ... ] )

This declares a класс event. This event is raised by using the RAISE keyword.

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

Example

EVENT BeforeSend(Data AS String)

...

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 method called in the event listener when an event is raised.

For example, if you have a класс called FancyButton and you throw an event called FancyClick, and if in your form called FMain you have a FancyButton object named MyButton, the event handler method 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 класс, as well as control groups whose information is applicable to any event-raising класс.

See also

Event Management, Using reserved keywords as identifiers