# TXDrawingControl.PrintPaint Method

> Renders the displayed shapes on the specified System.Drawing.Graphics object.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 23.0
- **Namespace:** `TXTextControl.Drawing`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXDrawing.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDrawing.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.Drawing > TXDrawingControl.PrintPaint Method
- **1057 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/printpaint-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/printpaint-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/printpaint-method/llms-full.txt

---

### Description

Renders the displayed [shapes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/shapes-property/llms-full.txt) on the specified `System.Drawing.Graphics` object.

### Syntax

#### PrintPaint(Graphics, Rectangle)

Renders only the displayed [shapes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/shapes-property/llms-full.txt) on the specified `System.Drawing.Graphics` object. No activated UI elements are rendered.

```csharp
public void PrintPaint(Graphics graphics, Rectangle position);
```

```vbnet
Public Sub PrintPaint(graphics As Graphics, position As Rectangle)
```

| Parameter | Description |
|---|---|
| graphics | Specifies the object of type `System.Drawing.Graphics` the displayed shapes are rendered to. |
| position | Specifies the position to draw on the specified `System.Drawing.Graphics` object. |

#### PrintPaint(Graphics, Rectangle, bool)

Renders the displayed [shapes](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/shapes-property/llms-full.txt) on the specified `System.Drawing.Graphics` object with or without activated UI elements.

```csharp
public void PrintPaint(Graphics graphics, Rectangle position, bool showUIElements);
```

```vbnet
Public Sub PrintPaint(graphics As Graphics, position As Rectangle, showUIElements As Boolean)
```

| Parameter | Description |
|---|---|
| graphics | Specifies the object of type `System.Drawing.Graphics` the displayed shapes are rendered to. |
| position | Specifies the position to draw on the specified `System.Drawing.Graphics` object. |
| showUIElements | Specifies whether the activated UI elements are rendered on the specified `System.Drawing.Graphics` object or not. |

#### PrintPaint(Rectangle, bool)

```csharp
public string PrintPaint(Rectangle position, bool showHandles);
```

```vbnet
Public Function PrintPaint(position As Rectangle, showHandles As Boolean) As String
```

### Examples

The following example uses Print Paint in a focused TXDrawing Control workflow.

```csharp
var result = tXDrawingControl.PrintPaint(new System.Drawing.Rectangle(20, 20, 600, 400), true);
Console.WriteLine($"Print Paint result: {result}");
```

```vbnet
Dim result = tXDrawingControl.PrintPaint(New System.Drawing.Rectangle(20, 20, 600, 400), True)
Console.WriteLine($"Print Paint result: {result}")
```

---

## Nearby

- **Previous:** [TXDrawingControl.Paste Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/paste-method/llms-full.txt)
- **Next:** [TXDrawingControl.Redo Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-drawing/txdrawingcontrol/redo-method/llms-full.txt)
