# DialogButtonCollection.Remove Method

> Removes an object of type DialogButton from the collection.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 3.0
- **Namespace:** `TXTextControl.Proofing`
- **Package:** `TXTextControl.TXSpell.WinForms.SDK` (assembly `TXSpell.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXSpell.Windows.Forms.dll` from the setup
- **Path:** TX Spell .NET for Windows Forms > Reference > TXTextControl.Proofing > DialogButtonCollection.Remove Method
- **473 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/remove-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/remove-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/remove-method/llms-full.txt

---

### Description

Removes an object of type [DialogButton](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbutton/llms-full.txt) from the [collection](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/llms-full.txt).

### Syntax

```csharp
public void Remove(DialogButton button);
```

```vbnet
Public Sub Remove(button As DialogButton)
```

### Parameters

| Parameter | Description |
|---|---|
| button | Specifies an object of type [DialogButton](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbutton/llms-full.txt). |

### Examples

The following example removes the first dialog button when the collection is not empty.

```csharp
if (dialogButtonCollection.Count > 0)
{
    TXTextControl.Proofing.DialogButton dialogButton = dialogButtonCollection[1];
    dialogButtonCollection.Remove(dialogButton);
}
```

```vbnet
If dialogButtonCollection.Count > 0 Then
    Dim dialogButton As TXTextControl.Proofing.DialogButton = dialogButtonCollection.Item(1)
    dialogButtonCollection.Remove(dialogButton)
End If
```

### Remarks

This method throws an exception when called while the SpellCheckDialog is open.

---

## Nearby

- **Previous:** [DialogButtonCollection.Item Method](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/item-method/llms-full.txt)
- **Next:** [DialogButtonEventArgs Class](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoneventargs/llms-full.txt)
