# TXBarcodeControl.PrintPaint Method

> Draws the barcode on the specified System.Drawing.Graphics object.

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

---

### Description

Draws the barcode on the specified `System.Drawing.Graphics` object.

### Syntax

#### PrintPaint(Graphics, Rectangle)

Draws the barcode on the specified `System.Drawing.Graphics` object.

```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 barcode is printed to. |
| position | Specifies the position to draw on the specified `System.Drawing.Graphics` object. |

#### PrintPaint(Rectangle)

```csharp
public string PrintPaint(Rectangle rectangle);
```

```vbnet
Public Function PrintPaint(rectangle As Rectangle) As String
```

### Examples

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

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

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

---

## Nearby

- **Previous:** [TXBarcodeControl.Load Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-barcode/txbarcodecontrol/load-method/llms-full.txt)
- **Next:** [TXBarcodeControl.Save Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-barcode/txbarcodecontrol/save-method/llms-full.txt)
