# TXBarcodeControl.ForeColor Property

> Gets or sets the foreground color for the barcode. The default value is null and represents the color SystemColors.WindowTextColor.

- **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.ForeColor Property
- **418 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/forecolor-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/forecolor-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/forecolor-property/llms-full.txt

---

### Description

Gets or sets the foreground color for the barcode. The default value is null and represents the color `SystemColors.WindowTextColor`.

### Syntax

```csharp
public Color? ForeColor { get; set; }
```

```vbnet
Public Property ForeColor As Color?
```

### Examples

The following example uses `TXBarcodeControl.ForeColor` to set the txbarcode control's foreground color. The configured value is checked before the workflow continues.

```csharp
tXBarcodeControl.ForeColor = System.Windows.Media.Colors.CornflowerBlue;
if (tXBarcodeControl.ForeColor != null)
{
    Console.WriteLine("TXBarcode Control: Fore Color is available.");
}
```

```vbnet
tXBarcodeControl.ForeColor = System.Windows.Media.Colors.CornflowerBlue
If tXBarcodeControl.ForeColor IsNot Nothing Then
    Console.WriteLine("TXBarcode Control: Fore Color is available.")
End If
```

---

## Nearby

- **Previous:** [TXBarcodeControl Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/constructor/llms-full.txt)
- **Next:** [TXBarcodeControl.GetDefaultText Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf-barcode/txbarcodecontrol/getdefaulttext-method/llms-full.txt)
