> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/wisej.web/containers/tabcontrol/wisej.web.tabcontrolcanceleventhandler.md).

# TabControlCancelEventHandler

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Represents the method that will handle the [Selecting](/api/wisej.web/containers/tabcontrol.md#selecting) or [Deselecting](/api/wisej.web/containers/tabcontrol.md#deselecting) event of a [TabControl](/api/wisej.web/containers/tabcontrol.md) control.

{% tabs %}
{% tab title="C#" %}

```csharp
public delegate void TabControlCancelEventHandler(Object sender, TabControlCancelEventArgs e)
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Delegate Sub TabControlCancelEventHandler(ByVal sender As [Object], ByVal e As TabControlCancelEventArgs)
```

{% endtab %}
{% endtabs %}

## Parameters

| Name       | Type                                                                                                     | Description                                                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **sender** | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                            | The source of the event.                                                                                                                 |
| **e**      | [TabControlCancelEventArgs](/api/wisej.web/containers/tabcontrol/wisej.web.tabcontrolcanceleventargs.md) | A [TabControlCancelEventArgs](/api/wisej.web/containers/tabcontrol/wisej.web.tabcontrolcanceleventargs.md) that contains the event data. |

## Fired By

| Name                                                                          | Description                                                                              |
| ----------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [TabControl.Selecting](/api/wisej.web/containers/tabcontrol.md#selecting)     | Occurs before a tab is selected, enabling a handler to cancel the tab change.            |
| [TabControl.TabClosing](/api/wisej.web/containers/tabcontrol.md#tabclosing)   | Occurs before a tab is closed by the user, enabling a handler to cancel the tab closing. |
| [TabControl.Deselecting](/api/wisej.web/containers/tabcontrol.md#deselecting) | Occurs before a tab is deselected, enabling a handler to cancel the tab change.          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/containers/tabcontrol/wisej.web.tabcontrolcanceleventhandler.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
