# TXBarcodeControl.Text Property

> Gets or sets the text the barcode should encrypt. This is a dependency property.

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

---

### Description

Gets or sets the text the barcode should encrypt. This is a dependency property.

### Syntax

```csharp
public string Text { get; set; }
```

```vbnet
Public Property Text As String
```

### Examples

The following example uses `TXBarcodeControl.Text` to replace the txbarcode control's displayed content. The configured value is checked before the workflow continues.

```csharp
tXBarcodeControl.Text = "Quarterly results";
if (!string.IsNullOrWhiteSpace(tXBarcodeControl.Text))
{
    Console.WriteLine($"Text: {tXBarcodeControl.Text}");
}
```

```vbnet
tXBarcodeControl.Text = "Quarterly results"
If Not String.IsNullOrWhiteSpace(tXBarcodeControl.Text) Then
    Console.WriteLine($"Text: {tXBarcodeControl.Text}")
End If
```

### Remarks

Throws an `ArgumentException`, if the value is not valid for the conditions of the current [barcode type](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/barcodetype-property/llms-full.txt).

---

## Nearby

- **Previous:** [TXBarcodeControl.ShowText Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/showtext-property/llms-full.txt)
- **Next:** [TXBarcodeControl.TextAlignment Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/textalignment-property/llms-full.txt)
