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:
- Reference the
DevExpress.WinUI
NuGet package. Refer to the following topic for more information: Get Started. - Add the following markup to a XAML page:
<dxc:BarCodeControl>
…</dxc:BarCodeControl>
. - 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>
#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:
- Codabar
- Code 11 (USD-8)
- Code 128
- Code 39 (USD-3)
- Code 39 Extended
- Code 93
- Code 93 Extended
- EAN 8
- EAN 13
- GS1-128 - EAN-128 (UCC)
- GS1 - DataBar
- Industrial 2 of 5
- Intelligent Mail Package
- Interleaved 2 of 5
- Matrix 2 of 5
- MSI - Plessey
- PostNet
- UPC Shipping Container Symbol (ITF-14)
- UPC Supplemental 2
- UPC Supplemental 5
- UPC-A
- UPC-E0
- UPC-E1
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.