# BarcodeFrame.AddUndoUnit Method

> Adds the current state of the barcode which is connected with this BarcodeFrame to the undo stack. Programmatic changes performed with the barcode's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the barcode frame's layout in the text is changed.

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

---

### Description

Adds the current state of the barcode which is connected with this BarcodeFrame to the undo stack. Programmatic changes performed with the barcode's properties and methods are not automatically added to a TextControl's undo stack. Calling this method is not necessary, when the barcode frame's layout in the text is changed.

### Syntax

```csharp
public void AddUndoUnit();
```

```vbnet
Public Sub AddUndoUnit()
```

### Examples

The following example adds the current barcode frame change to the undo history. The created object is then available to the surrounding document workflow.

```csharp
barcodeFrame.AddUndoUnit();
Console.WriteLine("Barcode Frame is ready for use.");
```

```vbnet
barcodeFrame.AddUndoUnit()
Console.WriteLine("Barcode Frame is ready for use.")
```

---

## Nearby

- **Previous:** [BarcodeFrame Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/barcodeframe/llms-full.txt)
- **Next:** [BarcodeFrame.Barcode Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-datavisualization/barcodeframe/barcode-property/llms-full.txt)
