# TextControl.CanUndo Property

> Gets a value indicating whether the user can undo the previous operation in a Text Control.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 16.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.CanUndo Property
- **275 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/canundo-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/canundo-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/canundo-property/llms-full.txt

---

### Description

Gets a value indicating whether the user can undo the previous operation in a Text Control.

### Syntax

```csharp
public bool CanUndo { get; }
```

```vbnet
Public ReadOnly Property CanUndo As Boolean
```

### Examples

The following example checks can undo before performing the related operation.

```csharp
if (textControl.CanUndo)
{
    textControl.Undo();
}
```

```vbnet
If textControl.CanUndo Then
    textControl.Undo()
End If
```

### Limitations

Runtime only.

Read only.

---

## Nearby

- **Previous:** [TextControl.CanTableFormat Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/cantableformat-property/llms-full.txt)
- **Next:** [TextControl.CaretWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/caretwidth-property/llms-full.txt)
