TX Text Control .NET for WPF

TXBarcodeControl Class

Class|Introduced in 29.0
Namespace
TXTextControl.WPF.Barcode
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXBarcode.WPF.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXBarcode.WPF.dll from the setup.
Inherits
  1. FrameworkElement
  2. TXBarcodeControl

Description

The TXBarcodeControl class provides properties to define type and format of the barcode it displays in WPF. It can be added to a document with the WPF.TextControl.Barcodes property. The WPF.TXBarcodeControl class is inherited from the System.Windows.FrameworkElement class. The following describes only the properties, methods and events defined through the WPF.TXBarcodeControl class. For a list of properties, methods and events inherited from the System.Windows.FrameworkElement class see the .NET Framework reference.

Syntax

public class TXBarcodeControl : FrameworkElement

Examples

The following example creates a TXBarcode Control instance and configures its additional text setting for a document workflow.

TXTextControl.WPF.Barcode.TXBarcodeControl tXBarcodeControl = new();
tXBarcodeControl.AdditionalText = "Quarterly results";

Members

Constructors

ConstructorDescription
TXBarcodeControlInitializes a new instance of the TXBarcodeControl class.

Properties

PropertyDescription
AdditionalTextGets or sets an additional text that is displayed below or above the barcode image.
AlignmentGets or sets the alignment of the barcode image inside the control. The default value is TXTextControl.Barcode.Alignment.MiddleCenter.
AngleGets or sets the angle of the barcode image inside the control. The default value is 0.
BackColorGets or sets the background color for the barcode control. The default value is null and represents the color SystemColors.WindowColor.
BarcodeTypeGets or sets the type of barcode that should be displayed. This is a dependency property.
BarcodeTypeSettingsGets an object of type BarcodeTypeSettings to determine type specific settings for the current used barcode.
ForeColorGets or sets the foreground color for the barcode. The default value is null and represents the color SystemColors.WindowTextColor.
ShowTextGets or sets a value indicating whether the barcode text is displayed below or above the barcode image or not. The default value is true.
TextGets or sets the text the barcode should encrypt. This is a dependency property.
TextAlignmentGets or sets a value indicating whether the barcode text and additional text is displayed below or above the barcode image. The default value is Bottom.
UpperTextLengthGets or sets the maximum number of characters the Text property can have. This is a dependency property.

Methods

MethodDescription
GetDefaultTextReturns the default text for the specified barcode type.
GetMaximumTextLengthReturns the maximum text length the specified barcode type can have.
GetMinimumTextLengthReturns the minimum text length the specified barcode type can have.
GetSVGNot described in the reference. public string GetSVG(Size size);
IsTextValidReturns a value whether the specified text is valid for a specific barcode type. In case of invalid text an appropriate exception message is saved into the specified string.
LoadLoads barcode data into the control.
PrintPaintDraws the barcode on a specific object of type System.Drawing.Graphics or System.Windows.Media.DrawingContext with specified bounds or stretch factor.
SaveSaves the barcode data.
SaveImageSaves the barcode image.