# ServerTextControl.OnSubTextPartDeleted Method

> Raises the SubTextPartDeleted event.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 25.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.Server.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Server.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > ServerTextControl.OnSubTextPartDeleted Method
- **518 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onsubtextpartdeleted-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onsubtextpartdeleted-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onsubtextpartdeleted-method/llms-full.txt

---

### Description

Raises the SubTextPartDeleted event.

### Syntax

```csharp
protected virtual void OnSubTextPartDeleted(SubTextPartEventArgs e);
```

```vbnet
Protected Overridable Sub OnSubTextPartDeleted(e As SubTextPartEventArgs)
```

### Parameters

| Parameter | Description |
|---|---|
| e | Specifies an [SubTextPartEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/subtextparteventargs/llms-full.txt) object that contains the event data. |

### Examples

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

```csharp
class CustomServerTextControl : ServerTextControl
{
    protected override void OnSubTextPartDeleted(SubTextPartEventArgs e)
    {
        // Add custom processing before registered event handlers run.
        base.OnSubTextPartDeleted(e);
    }
}
```

```vbnet
Class CustomServerTextControl
    Inherits ServerTextControl

    Protected Overrides Sub OnSubTextPartDeleted(e As SubTextPartEventArgs)
        ' Add custom processing before registered event handlers run.
        MyBase.OnSubTextPartDeleted(e)
    End Sub
End Class
```

---

## Nearby

- **Previous:** [ServerTextControl.OnSubTextPartCreated Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/onsubtextpartcreated-method/llms-full.txt)
- **Next:** [ServerTextControl.OnTableCreated Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/ontablecreated-method/llms-full.txt)
