# TextControl.OnChartDeleted Method

> Raises the ChartDeleted event.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 18.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > TextControl.OnChartDeleted Method
- **512 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/onchartdeleted-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/onchartdeleted-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/onchartdeleted-method/llms-full.txt

---

### Description

Raises the ChartDeleted event.

### Syntax

```csharp
protected virtual void OnChartDeleted(ChartEventArgs e);
```

```vbnet
Protected Overridable Sub OnChartDeleted(e As ChartEventArgs)
```

### Parameters

| Parameter | Description |
|---|---|
| e | Specifies a [ChartEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-datavisualization/charteventargs/llms-full.txt) object that contains the event data. |

### Examples

The following example extends Text Control and performs custom processing when On Chart Deleted is invoked.

```csharp
class CustomTextControl : TextControl
{
    protected override void OnChartDeleted(TXTextControl.DataVisualization.ChartEventArgs e)
    {
        // Add custom processing before registered event handlers run.
        base.OnChartDeleted(e);
    }
}
```

```vbnet
Class CustomTextControl
    Inherits TextControl

    Protected Overrides Sub OnChartDeleted(e As TXTextControl.DataVisualization.ChartEventArgs)
        ' Add custom processing before registered event handlers run.
        MyBase.OnChartDeleted(e)
    End Sub
End Class
```

---

## Nearby

- **Previous:** [TextControl.OnChartCreated Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/onchartcreated-method/llms-full.txt)
- **Next:** [TextControl.OnChartDeselected Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/onchartdeselected-method/llms-full.txt)
