Method

# IsEventImplemented

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to determine if a specific event has been implemented (has code) or not.

## Usage

``` xojo
result = IsEventImplemented(eventName)
```

| Part      | Type                               | Description                                                                                       |
|-----------|------------------------------------|---------------------------------------------------------------------------------------------------|
| result    | `Boolean</api/data_types/boolean>` | `True</api/language/true>` if eventName is a valid event; `False</api/language/false>` otherwise. |
| eventName | `String</api/data_types/string>`   | The event whose implementation state is being determined.                                         |

**or**

``` xojo
result = IsEventImplemented(obj, eventName)
```

| Part      | Type                                              | Description                                                                                       |
|-----------|---------------------------------------------------|---------------------------------------------------------------------------------------------------|
| result    | `Boolean</api/data_types/boolean>`                | `True</api/language/true>` if eventName is a valid event; `False</api/language/false>` otherwise. |
| obj       | `Object</api/data_types/additional_types/object>` | Object for which it is checked whether it has implemented the specified event.                    |
| eventName | `String</api/data_types/string>`                  | The event whose implementation state is being determined.                                         |

## Notes

This method must be called from one of the events or methods of the same class.

It will return `True</api/language/true>` whether the event was implemented by entering code directly into the event or if the event is being routed elsewhere via `AddHandler</api/language/addhandler>`.

## Sample code

From the Opening event of a button subclass to determine if the Pressed event is implemented:

``` xojo
If IsEventImplemented("Pressed") Then
  MessageBox("The Pressed event is implemented.")
End If
```

If you have a regular Button on your layout, you can determine if the Pressed event is implemented that way:

``` xojo
If IsEventImplemented(Button1, "Pressed") Then
  MessageBox("The Pressed event is implemented.")
End If
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, Linux, macOS, Windows    |

<div class="seealso">

`Introspection</api/language/introspection/introspection>` module.

</div>
