# TextControl.BeginUndoAction Method

> Begins a user-defined undo operation. All editing and fomatting changes made between BeginUndoAction and EndUndoAction belong to the undo operation. These changes are undone or redone in a single step. The specified user-defined name is available with the UndoActionName property.

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

---

### Description

Begins a user-defined undo operation. All editing and fomatting changes made between BeginUndoAction and [EndUndoAction](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/endundoaction-method/llms-full.txt) belong to the undo operation. These changes are undone or redone in a single step. The specified user-defined name is available with the [UndoActionName](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/undoactionname-property/llms-full.txt) property.

### Syntax

```csharp
public void BeginUndoAction(string actionName);
```

```vbnet
Public Sub BeginUndoAction(actionName As String)
```

### Parameters

| Parameter | Description |
|---|---|
| actionName | Specifies the undo action's name. If an action name is not necessary, this parameter can be null or an empty string. |

### Examples

The following example starts a named, compound undo action. The created object is then available to the surrounding document workflow.

```csharp
textControl.BeginUndoAction("CustomerName");
Console.WriteLine("Text Control is ready for use.");
```

```vbnet
textControl.BeginUndoAction("CustomerName")
Console.WriteLine("Text Control is ready for use.")
```

---

## Nearby

- **Previous:** [TextControl.Baseline Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/baseline-property/llms-full.txt)
- **Next:** [TextControl.BorderThickness Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/borderthickness-property/llms-full.txt)
