# OnCloseTab

The **OnCloseTab** event can be implemented by a [script add-in](../../../scripting/script_add-ins) to receive notification when a tab is closed in a Lister.

| **Method Name:**   | OnCloseTab                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Argument Type:** | [**CloseTabData**](../scripting_objects/closetabdata)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **Return Type:**   | _bool_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **Description:**   | <p>The <strong>CloseTabData.tab</strong> property identifies the tab that is closing. You can return <strong>True</strong> from this event to prevent the tab from closing, or <strong>False</strong> (which is the default) to allow it to close.</p><p>Note that when a Lister closes this event is <strong>not</strong> triggered for each of its tabs - the <a href="oncloselister"><strong>OnCloseLister</strong></a> event provides notification when a Lister closes, and all the tabs in that Lister as discoverable through the <strong>CloseListerData.lister.tabs</strong> property.</p> |
