TX Text Control .NET for Windows Forms

TXBarcodeCore Class

Class|Introduced in 33.0
Namespace
TXTextControl.Barcode
Package
TXTextControl.TextControl.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXBarcode.dll
Install
dotnet add package TXTextControl.TextControl.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXBarcode.dll from the setup.
Implements
INotifyPropertyChanged

Description

The TXBarcodeCore class provides properties and methods to specify type and format of barcodes provided as a Scalable Vector Graphics (SVG). The class implements the System.ComponentModel.INotifyPropertyChanged interface. Before an instance of the TXBarcodeCore class can be used, it must be initialized by calling the Create method. Changes to the barcode that require updating the view can be listend via the ViewChanged event. The following describes only the properties defined through the TXBarcodeCore class. For a list of properties, methods and events inherited from the System.ComponentModel.INotifyPropertyChanged interface see the .NET Framework reference.

Syntax

public class TXBarcodeCore : INotifyPropertyChanged

Examples

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

TXTextControl.Barcode.TXBarcodeCore tXBarcodeCore = new();
tXBarcodeCore.AdditionalText = "Quarterly results";

Members

Constructors

ConstructorDescription
TXBarcodeCoreInitializes a new instance of the TXBarcodeCore 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 color is System.Drawing.SystemColors.Window.
BarcodeTypeGets or sets the type of barcode that is rendered.
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 color is System.Drawing.SystemColors.WindowText.
ShowTextGets or sets a value indicating whether the encrypted barcode text value is displayed below or above the barcode image or not. The default value is true.
SizeGets or sets the size of the barcode.
TextGets or sets the text the barcode should encrypt.
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 get.

Methods

MethodDescription
CreateInitializes the resources of a newly instantiated TXBarcodeCore object. This method must be called before using the object.
GetDefaultTextReturns the default text for the specified barcode type.
GetMaximumTextLengthReturns the maximum text length of the specified barcode type.
GetMinimumTextLengthReturns the minimum text length of the specified barcode type.
GetSVGCreates and returns a string representing a Scalable Vector Graphics (SVG) of the barcode.
IsTextValidReturns a value indicating whether the specified text is valid for a specific barcode type. In case of an invalid text, an exception message is saved into the specified string.
LoadLoads barcode data into the control.
SaveSaves the barcode data.

Events

EventDescription
PropertyChangedNot described in the reference. public event PropertyChangedEventHandler PropertyChanged;
ViewChangedOccurs when changes to the barcode settings require updating the barcode view.