Skip to main content

BarCodeEdit Class

Allows you to display various barcodes.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core


public class BarCodeEdit :


The BarCodeEdit control is used to display different kinds of barcodes.

bar code edit


The BarCodeEdit class inherits its features from the BaseEdit class.

Refer to the BaseEdit class description for information on derived features and API.

Create a BarCodeEdit

<Window ...

    <!-- Adds a default BarCodeEdit to your window -->
    <dxe:BarCodeEdit EditValue="" >
            <dxe:QRCodeStyleSettings CompactionMode="Byte" />

Editor Value

To specify the editor’s value, use the BaseEdit.EditValue or BarCodeEdit.BinaryData property.

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

To respond to changing the editor’s value, handle the BaseEdit.EditValueChanged event.

Barcode Types

The BarCodeEdit control can display 27 barcode types including the widely-used QR, UPC, and Intelligent mail.

To display the barcode of a specific type, set the BarCodeEdit.StyleSettings property value to a corresponding *StyleSettings object. Each StyleSettings object contains properties that allow you to configure a specific barcode type.

The following example demonstrates the configuration of a barcode editor that displays a QR Code.

<dxe:BarCodeEdit AutoModule="True" ShowText="False" EditValue="">
        <dxe:QRCodeStyleSettings CompactionMode="Byte" />

Error Correction

QR and PDF417 barcodes have built-in support for error correction.

<dxe:BarCodeEdit AutoModule="True" ShowText="False" EditValue="DevExpress">
        <dxe:PDF417StyleSettings ErrorCorrectionLevel="3"/>

Barcode Readability

The Module property allows you to customize the width of the narrowest bar or space. If the Module property is set to too small a value, a barcode output may become unreadable by the appropriate barcode scanner.

To better control the Module property value when resizing a barcode, set the BarCodeEdit.AutoModule property to true.


Barcode Text

The barcode editor can display a text specified by the EditValue property. For some barcode types it’s required, for other types it should be hidden. Set the ShowText property to true to display code text.

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


This example demonstrates how to use BarCodeEdit to display a QR code based on a custom value.

View Example

        xmlns:dxe="" x:Class="BarCodeEdit.MainWindow"
        Title="MainWindow" Height="300" Width="250">
            <RowDefinition Height="242" />
            <RowDefinition Height="*" />

        <dxe:BarCodeEdit Grid.Row="0" AutoModule="True" ShowText="False" EditValue="{Binding Path=Text,ElementName=textBox}" >
                <dxe:QRCodeStyleSettings CompactionMode="Byte" />
        <TextBox Grid.Row="1" Name="textBox">

See Also