BarCodeControl Class
A control that displays barcodes.
Namespace: DevExpress.WinUI.Controls
Assembly: DevExpress.WinUI.Controls.v21.1.dll
Declaration
Remarks
Create a BarCodeControl
Follow the steps below to add a BarCodeControl to an application:
- Reference the DevExpress WinUI NuGet package. Refer to the following topic for more information: Get Started.
- Add the following markup to a XAML page:
<Controls:BarCodeControl>
…</Controls:BarCodeControl>
. - Configure the component (see the sections below).
<Page ...
xmlns:Controls="using:DevExpress.WinUI.Controls">
<Controls:BarCodeControl AutoModule="True" Text="devexpress.com" ShowText="False">
<Controls:BarCodeControl.Symbology>
<Controls:QRCodeSymbology CompactionMode="Byte" Version="0"/>
</Controls:BarCodeControl.Symbology>
</Controls:BarCodeControl>
</Page>
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 27 barcode types including QR, UPC, and Intelligent Mail formats.
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.