# BarcodeOptions Constructor

> BarcodeOptions constructor in the .NET API: Creates native barcode settings; Symbology defaults to code128 and optional settings are omitted from transport.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Constructor
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > BarcodeOptions > BarcodeOptions Constructor
- **675 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodeoptions/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodeoptions/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodeoptions/constructor/llms-full.txt

---

Creates native barcode settings. BarcodeOptions.Symbology defaults to "code128"; optional settings remain null and are omitted from transport.

### Syntax

```csharp
public BarcodeOptions()
```

### Remarks

See [Barcodes and QR Codes](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/barcodes/llms-full.txt) for a complete .NET example, source validation, mail merge and file compatibility.

### Examples

Create and save a label workbook with the configured barcode settings.

```csharp
using TXTextControl.TXSheetControl.Server;

static async Task<byte[]> CreateLabelsAsync(ServerSheetControl control)
{
    var sheet = await control.Workbook.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("https://example.com/invoice/1042");
    var options = new BarcodeOptions {
        Symbology = "qrCode", Source = "A1", ShowText = false,
        Foreground = "#163b63", Background = "#ffffff", ErrorCorrection = "M", Version = 3
    };
    await sheet.Cell("B2").SetBarcodeAsync(options);
    await sheet.Cell("D2").SetBarcodeAsync(new BarcodeOptions { Symbology = "code128", Value = "001042", ShowText = true });
    var snapshot = await sheet.Cell("B2").GetBarcodeAsync();
    return await control.SaveAsync(StreamType.SpreadsheetML);
}
```

---

## Nearby

- **Previous:** [BarcodeOptions Class](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodeoptions/llms-full.txt)
- **Next:** [BarcodeOptions.Symbology Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/barcodeoptions/symbology-property/llms-full.txt)
