Skip to main content

BarCodeControl Class

A control that displays barcodes.

Namespace: DevExpress.WinUI.Controls

Assembly: DevExpress.WinUI.BarCode.v23.2.dll

NuGet Package: DevExpress.WinUI

Declaration

[ToolboxTabName("DX.23.2: Common Controls")]
public class BarCodeControl :
    Control,
    IFullBarCodeData,
    IBarCodeData

Remarks

Create a BarCodeControl

Follow the steps below to add a BarCodeControl to an application:

  1. Reference the DevExpress.WinUI NuGet package. Refer to the following topic for more information: Get Started.
  2. Add the following markup to a XAML page: <dxc:BarCodeControl></dxc:BarCodeControl>.
  3. Configure the component (see the sections below).
<Window ...
    xmlns:dxc="using:DevExpress.WinUI.Controls">

    <dxc:BarCodeControl AutoModule="True" Text="devexpress.com" ShowText="False" Width="110" Height="110">
        <dxc:BarCodeControl.Symbology>
            <dxc:QRCodeSymbology CompactionMode="Byte" Version="0"/>
        </dxc:BarCodeControl.Symbology>
    </dxc:BarCodeControl>
</Window>

BarCodeControl

Editor Value

Set Text to specify the BarCode value.

Use the BinaryData property to code a array of byte into the PDF417 or ECC200 bar code (when their CompactionMode is set to Binary).

Barcode Types

BarCodeControl can display the following one-dimensional bar codes:

BarCodeControl can display the following two-dimensional bar codes:

Our library contains classes that correspond to each supported barcode type. Specify a barcode type to the BarCodeControl.Symbology property and configure the barcode type properties to specify the displayed barcode type and settings.

Error Correction

QR and PDF417 barcodes support error correction.

<Controls:BarCodeControl AutoModule="True" Text="devexpress.com" ShowText="False">
    <Controls:BarCodeControl.Symbology>
        <Controls:PDF417Symbology ErrorCorrectionLevel="3"/>
    </Controls:BarCodeControl.Symbology>
</Controls:BarCodeControl>

Barcode Readability

The Module property allows you to customize the width of the narrowest bar or space. If the Module property is too small, barcode scanner cannot read the resulting barcode.

Set the BarCodeControl.AutoModule property to true to allow BarCodeControl to change the Module property value when a user resizes the barcode.

Barcode Text

The barcode editor can display a string specified by the Text property. Set the ShowText property to true to display code text (text visibility also depends on barcode type).

Use the HorizontalTextAlignment and VerticalTextAlignment properties to align the displayed text.

Implements

See Also