# DrawingFrame.AddUndoUnit Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.DataVisualization`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl.DataVisualization > DrawingFrame.AddUndoUnit Method
- **293 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/drawingframe/addundounit-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/drawingframe/addundounit-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/drawingframe/addundounit-method/llms-full.txt

---

### Description

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

### Syntax

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

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

### Examples

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

```csharp
drawingFrame.AddUndoUnit();
Console.WriteLine("Drawing Frame is ready for use.");
```

```vbnet
drawingFrame.AddUndoUnit()
Console.WriteLine("Drawing Frame is ready for use.")
```

---

## Nearby

- **Previous:** [DrawingFrame.Activate Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/drawingframe/activate-method/llms-full.txt)
- **Next:** [DrawingFrame Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-datavisualization/drawingframe/constructor/llms-full.txt)
