TX Barcode .NET Programmer's Guide

Welcome to TX Barcode .NET, the versatile .NET barcode component. TX Barcode .NET enables developers to integrate barcodes into .NET-based applications. In today's processes, barcodes are included everywhere: Invoices, delivery notes or admission tickets. Barcodes are used to store digital data on paper that can be acquired easily for further processing using laser-based scanners, cameras or mobile phones.

TX Barcode .NET is a powerful component to create barcodes in a very efficient way. It can be completely integrated into TX Text Control, the leading word processing component for .NET. TX Text Control comes with a BarcodeCollection to add and remove barcodes of type TXBarcode. These barcode objects can be positioned and used like any other object, such as images or text frames.

As an aid to help you locate the information that interests you most, the following section lists and describes the main areas of the documentation.

  • Introduction

    This section provides information about the system requirements you need and how to obtain support.

  • Windows Forms User's Guide

    This guide describes how to create TX Barcode .NET for Windows Forms applications with Visual Studio and shows how to use TX Barcode .NET for Windows Forms in combination with TX Text Control .NET for Windows Forms.

  • WPF User's Guide

    This guide describes how to create TX Barcode .NET for WPF applications with Visual Studio and shows how to use TX Barcode .NET for WPF in combination with TX Text Control .NET for WPF.

  • Resource Kit

    This chapter shows how to use the resource kit that enables developers to display TX Barcode .NET's user interface parts in languages other than English and German.

  • Distributing your Applications

    This chapter lists the TX Barcode .NET files that must be deployed with your applications.

  • Class Library Reference

    The TX Barcode .NET class library in detail and alphabetical order.


Introduction

This section provides information about the system requirements you need and how to obtain support.

System Requirements

How to Obtain Support

Legal Notice


System Requirements

TX Barcode .NET requires one of the following Windows versions:

  • Windows XP
  • Windows Server 2003
  • Windows Vista
  • Windows Server 2008
  • Windows 7
  • Windows 8

TX Barcode .NET supports the following development enviroments:

  • Microsoft Visual Basic .NET
  • Microsoft Visual C# .NET
  • Microsoft Internet Information Server 5.0, 5.1, 6.0

TX Barcode .NET supports the following Microsoft .NET Frameworks:

  • .NET 2.0
  • .NET 3.0
  • .NET 3.5
  • .NET 4.0
  • .NET 4.5


How to Obtain Support

Every registered and free trial version user can benefit from our free, technical support.

Our support team provides several information sources for technical details. A good starting point for getting information is the TX Barcode .NET Support Forum. Here you can post your problems and discuss them with our support staff and other experienced TX Barcode .NET users.

You can find further samples in our Source Code Library. This library has additional samples that are not provided in this release and is updated with new samples frequently.

If you would like to contact us via e-mail, please use the Support Form.

We understand that there are some support cases where a one-to-one talk can solve some programming problem much quicker than endless e-mails.

Our customer services representatives and support agents speak English and German and are available to assist with all your sales and technical queries.

Contact Information

Please visit our website for contact details:

http://support.textcontrol.com


Legal Notice

Information in this document is subject to change without notice and does not represent a commitment on the part of Text Control GmbH. The Software described in this document is furnished under a license agreement. The Software may only be used or copied in accordance with the terms of this agreement.

Copyright 1991-2013 Text Control GmbH. All rights reserved.

Microsoft, Windows, Visual Basic .NET, Visual C#, Visual Studio are either registered trademarks or trademarks of Microsoft Corporation in the USA and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.


Windows Forms User's Guide

This guide describes how to create TX Barcode .NET for Windows Forms applications with Visual Studio and shows how to use TX Barcode .NET for Windows Forms in combination with TX Text Control .NET for Windows Forms.

Tutorial: Starting with Microsoft Visual Studio 2012 (2010), TX Text Control and TX Barcode

Tutorial: Inserting a dynamically created Barcode control into TX Text Control

Replacing the barcode text dynamically

Implementing a custom barcode dialog

Implementing a custom DataGridViewBarcodeCell


Tutorial: Starting with Microsoft Visual Studio 2012 (2010), TX Text Control and TX Barcode

This tutorial shows the required steps to insert a TX Barcode .NET control into a TX Text Control document.

The source code is contained in the following directories:

  • Samples\WinForms\CSharp\TextControl\Tutorial
  • Samples\WinForms\VB.NET\TextControl\Tutorial

1. Creating the project and controls

2. Insert the barcode into the document


1. Creating the project and controls

Start Visual Studio .NET and create a new project. Select either Visual Basic or C# as a project type, and Windows Forms Application as a template.

Find the TX Text Control 19.0 toolbox tab that has been created automatically. All usable TX Text Control controls or components are listed in this tab.

Click on the TextControl icon and draw it on the form.

Find the TX Barcode 2.0 toolbox tab that has been created automatically. The available barcode control is listed in this tab.

Click on the TXBarcodeControl icon and draw it somewhere onto the form.


2. Insert the barcode into the document

Add a MenuStrip to the form and add the menu Insert with a submenu item Barcode to this MenuStrip.

Double-click the just created submenu item Barcode to insert the Clicked event handler.

Add the following code to the Click procedure of the menu item:

[C#]
private void barcodeToolStripMenuItem_Click(object sender, EventArgs e)
{
    TXTextControl.DataVisualization.BarcodeFrame bcFrame =
        new TXTextControl.DataVisualization.BarcodeFrame(txBarcodeControl1);
    textControl1.Barcodes.Add(bcFrame, -1);
}
[Visual Basic]
Private Sub barcodeToolStripMenuItem_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles barcodeToolStripMenuItem_Click.Click
    Dim bcFrame as TXTextControl.DataVisualization.BarcodeFrame = _
        New TXTextControl.DataVisualization.BarcodeFrame(txBarcodeControl1)
    textControl1.Barcodes.Add(bcFrame, -1)
End Sub

Start the application, open the main menu and choose Barcode from the Insert menu. The TXBarcodeControl object has been added to the document in TextControl and is saved along with the document when saved as a document.


Tutorial: Inserting a dynamically created Barcode control into TX Text Control

While the tutorial uses a visual instance of TXBarcodeControl on a form, this sample shows how to add a dynamically created TXBarcodeControl to the BarcodeCollection of TX Text Control.

The source code is contained in the following directories:

  • Samples\WinForms\CSharp\TextControl\Simple
  • Samples\WinForms\VB.NET\TextControl\Simple

1. Creating the project and controls

Start Visual Studio .NET and create a new project. Select either Visual Basic or C# as a project type, and Windows Application as a template.

Find the TX Text Control 19.0 toolbox tab that has been created automatically. All usable TX Text Control controls or components are listed in this tab.

Click on the TextControl icon and draw it on the form.

Choose Add Reference... from the main menu Project to open the Reference Manager dialog. Select Assemblies -> Extensions and find the TXBarcode assemblies TXBarcode and TXBarcode.Windows.Forms. Check both and confirm with OK.

In the Solution Explorer, open the licenses.licx which is located in the project's Properties. Add the following string:

TXTextControl.Barcode.TXBarcodeControl, TXBarcode.Windows.Forms, Version=2.0.100.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638

Add a MenuStrip to the form and add the menu Insert with a submenu item Barcode to this MenuStrip.

Double-click the just created submenu item Barcode to insert the Clicked event handler.

Add the following code to the Click procedure of the menu item:

[C#]
private void barcodeToolStripMenuItem_Click(object sender, EventArgs e)
{
    TXTextControl.Barcode.TXBarcodeControl txBarcode1 =
        new TXTextControl.Barcode.TXBarcodeControl();

    txBarcode1.BarcodeType =
        TXTextControl.Barcode.TXBarcode.BarcodeType.QRCode;
    txBarcode1.UpperTextLength = 19;
    txBarcode1.Text = "www.textcontrol.com";

    TXTextControl.DataVisualization.BarcodeFrame bf =
        new TXTextControl.DataVisualization.BarcodeFrame(txBarcode1);

    textControl1.Barcodes.Add(bf, -1);
}
[Visual Basic]
Private Sub barcodeToolStripMenuItem_Click(sender As Object, e As EventArgs)
    Dim txBarcode1 As New TXTextControl.Barcode.TXBarcodeControl()

    txBarcode1.BarcodeType = TXTextControl.Barcode.TXBarcode.BarcodeType.QRCode
    txBarcode1.UpperTextLength = 19
    txBarcode1.Text = "www.textcontrol.com"

    Dim bf As New TXTextControl.DataVisualization.BarcodeFrame(txBarcode1)

    textControl1.Barcodes.Add(bf, -1)
End Sub

Start the application, open the main menu and choose Barcode from the Insert menu. A new TXBarcodeControl is created dynamically, it's type is set to QRCode and the Text is set. Finally, the barcode is added to TextControl's BarcodeCollection.


Replacing the barcode text dynamically

This sample shows how to insert a barcode control into a TX Text Control with a specific name. Based on the barcode's name, data is merged dynamically into the control from an external XML data source.

The source code is contained in the following directories:

  • Samples\WinForms\CSharp\TextControl\ReplaceData
  • Samples\WinForms\VB.NET\TextControl\ReplaceData

Replacing the barcode text dynamically

A real-world scenarios, barcodes are added to document templates that are used for invoices, delivery notes or bank statements. On each of these documents, barcodes are used nowadays.

Open the sample application in Visual Studio and run it. Choose Barcode from the main menu Insert to open the Insert Barcode dialog. Choose a Barcode Type and one of the four available BarcodeFrame Name options. Insert the barcode using Insert.

Repeat the above step as many times as you want with different names.

Now, choose Replace from the Data main menu.

The sample iterates through all data rows of the loaded XML data source. If a BarcodeFrame matches the Name column in the data row, the value is applied to the barcode.


Implementing a custom barcode dialog

This sample shows how to implement a custom barcode dialog by using the most common properties of TX Barcode .NET.

The source code is contained in the following directories:

  • Samples\WinForms\CSharp\Simple
  • Samples\WinForms\VB.NET\Simple

Implementing a custom barcode dialog

This sample should show how to use the most commonly used properties of TX Barcode .NET. To outline a typical scenario, a custom dialog has been implemented to adjust the barcode type, the text, color and rotation.

Open the sample project in Visual Studio and start it. The dialog uses a TXBarcodeControl to preview the adjusted settings. When changing the Barcode Type, you will recognize that the default Text and the Upper Text Length is changed automatically.

Each type has its' own constraints such as a minimum or maximum text length. This sample dialog implements the validation of these constraints using the available methods.

An example: If the Text is changed, the GetMinimumTextLength property is used to compare whether the new text length is larger than this minimum length.

Additionally, the IsTextValid method is used to check the validity of the new text. Specific constraints could be the usage of numeric values only or only a specific collection of alphanumeric values.

[C#]
private void textBox1_TextChanged(object sender, EventArgs e)
{
    if (textBox1.Text.Length < TXTextControl.Barcode.TXBarcodeControl.GetMinimumTextLength(txBarcodeControl1.BarcodeType))
        return;

    string sError;

    if (TXTextControl.Barcode.TXBarcodeControl.IsTextValid(txBarcodeControl1.BarcodeType, textBox1.Text, out sError) == true)
        txBarcodeControl1.Text = textBox1.Text;
    else
        MessageBox.Show(sError);
}

You can change the Barcode Fore Color and the Barcode Back Color as well as the Angle between 0 and 360 degrees and the alignment of the barcode in it's control panel.


Implementing a custom DataGridViewBarcodeCell

Barcodes are not only used in documents or forms. A typical application is the display of a specific cell value as a barcode in a DataGridView. This sample shows how to use TX Barcode .NET to implement a custom DataGridViewBarcodeCell.

The source code is contained in the following directories:

  • Samples\WinForms\CSharp\DataGridViewBarcode
  • Samples\WinForms\VB.NET\DataGridViewBarcode

Implementing a custom DataGridViewBarcodeCell

A DataGridView cell has two modes: An edit mode that is used when the user types in the value for the cell and a display mode that shows an image representation of the barcode.

Open the sample project in Visual Studio and start the application. A form with a DataGridView is shown. The column Barcode column shows barcode images.

Use the mouse and click into one of the shown barcodes to select the cell. Click again to activate the edit mode of the custom cell. A text box is used as the editor in this case. Change the value to another numeric value such as "12345" and press return.

The barcode is updated, the custom cell switches to the display mode and shows the updated image representation.

In order to create the image representation, TX Barcode .NET provides a method that paints the actual barcode into a Graphics object. The following code shows how to use this method:

[C#]
Bitmap bmp = new Bitmap(cellSize.Width, cellSize.Height);
ctl.BackColor = DataGridView.DefaultCellStyle.SelectionBackColor;
ctl.ForeColor = DataGridView.DefaultCellStyle.SelectionForeColor;

Graphics g = Graphics.FromImage(bmp);
ctl.PrintPaint(g, new Rectangle(0, 0, bmp.Width, bmp.Height));


WPF User's Guide

This guide describes how to create TX Barcode .NET for WPF applications with Visual Studio and shows how to use TX Barcode .NET for WPF in combination with TX Text Control .NET for WPF.

Tutorial: Starting with Microsoft Visual Studio 2012 (2010), TX Text Control and TX Barcode

Tutorial: Inserting a dynamically created Barcode control into TX Text Control

Replacing the barcode text dynamically

Implementing a custom barcode dialog


Tutorial: Starting with Microsoft Visual Studio 2012 (2010), TX Text Control and TX Barcode

This tutorial shows the required steps to insert a TX Barcode .NET control into a TX Text Control document.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\Tutorial
  • Samples\WPF\VB.NET\TextControl\Tutorial

1. Creating the project and controls

2. Insert the barcode into the document


1. Creating the project and controls

Start Visual Studio .NET and create a new project. Select either Visual Basic or C# as a project type, and WPF Application as a template.

Find the TX Text Control 19.0 toolbox tab that has been created automatically. All usable TX Text Control controls or components are listed in this tab.

Click on the TextControl icon and draw it on the form.

Find the TX Barcode 2.0 toolbox tab that has been created automatically. The available barcode control is listed in this tab.

Click on the TXBarcodeControl icon and draw it somewhere onto the form.


2. Insert the barcode into the document

Add a Button to the form and add Insert Barcode as the Content.

Double-click the just created button to insert the Clicked event handler.

Add the following code to the Click procedure of the button:

[C#]
private void Button_Click_1(object sender, RoutedEventArgs e)
{
    TXTextControl.DataVisualization.BarcodeFrame bcFrame =
        new TXTextControl.DataVisualization.BarcodeFrame(txBarcodeControl1);
    textControl1.Barcodes.Add(bcFrame, -1);
}
[Visual Basic]
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
    Dim bcFrame As New TXTextControl.DataVisualization.BarcodeFrame(txBarcodeControl1)
    textControl1.Barcodes.Add(bcFrame, -1)
End Sub

Start the application and click the button Insert Barcode. The TXBarcodeControl object has been added to the document in TextControl and is saved along with the document when saved as a document.


Tutorial: Inserting a dynamically created Barcode control into TX Text Control

While the tutorial uses a visual instance of TXBarcodeControl on a form, this sample shows how to add a dynamically created TXBarcodeControl to the BarcodeCollection of TX Text Control.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\Simple
  • Samples\WPF\VB.NET\TextControl\Simple

1. Creating the project and controls

Start Visual Studio .NET and create a new project. Select either Visual Basic or C# as a project type, and WPF Application as a template.

Find the TX Text Control 19.0 toolbox tab that has been created automatically. All usable TX Text Control controls or components are listed in this tab.

Click on the TextControl icon and draw it on the form.

Choose Add Reference... from the main menu Project to open the Reference Manager dialog. Select Assemblies -> Extensions and find the TXBarcode assemblies TXBarcode and TXBarcode.WPF. Check both and confirm with OK.

In the Solution Explorer, open the licenses.licx which is located in the project's Properties. Add the following string:

TXTextControl.WPF.Barcode.TXBarcodeControl, TXBarcode.WPF, Version=2.0.100.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638

Add a MenuStrip to the form and add the menu Insert with a submenu item Barcode to this MenuStrip. The following XAML code is required to add this menu:

<Menu IsMainMenu="True" Name="menuBar" DockPanel.Dock="Top">
    <MenuItem Header="Insert" >
        <MenuItem Header="Barcode" Click="MenuItem_Click" />
    </MenuItem>
</Menu>

Navigate to the just created submenu item Barcode to insert the Clicked event handler.

Add the following code to the Click procedure of the menu item:

[C#]
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
    TXTextControl.WPF.Barcode.TXBarcodeControl txBarcode1 =
        new TXTextControl.WPF.Barcode.TXBarcodeControl();

    txBarcode1.BarcodeType =
        TXTextControl.Barcode.BarcodeType.QRCode;
    txBarcode1.UpperTextLength = 19;
    txBarcode1.Text = "www.textcontrol.com";

    TXTextControl.DataVisualization.BarcodeFrame bf =
        new TXTextControl.DataVisualization.BarcodeFrame(txBarcode1);

    textControl.Barcodes.Add(bf, -1);
}
[Visual Basic]
Private Sub MenuItem_Click(sender As Object, e As RoutedEventArgs)
    Dim txBarcode1 As New TXTextControl.WPF.Barcode.TXBarcodeControl()

    txBarcode1.BarcodeType = TXTextControl.Barcode.BarcodeType.QRCode
    txBarcode1.UpperTextLength = 19
    txBarcode1.Text = "www.textcontrol.com"

    Dim bf As New TXTextControl.DataVisualization.BarcodeFrame(txBarcode1)

    textControl.Barcodes.Add(bf, -1)
End Sub

Start the application, open the main menu and choose Barcode from the Insert menu. A new TXBarcodeControl is created dynamically, its' type is set to QRCode and the Text is set. Finally, the barcode is added to TextControl's BarcodeCollection.


Replacing the barcode text dynamically

This sample shows how to insert a barcode control into a TX Text Control with a specific name. Based on the barcode's name, data is merged dynamically into the control from an external XML data source.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\TextControl\ReplaceData
  • Samples\WPF\VB.NET\TextControl\ReplaceData

Replacing the barcode text dynamically

A real-world scenarios, barcodes are added to document templates that are used for invoices, delivery notes or bank statements. On each of these documents, barcodes are used nowadays.

Open the sample application in Visual Studio and run it. Choose Barcode from the main menu Insert to open the Insert Barcode dialog. Choose a Barcode Type and one of the four available BarcodeFrame Name options. Insert the barcode using Insert.

Repeat the above step as many times as you want with different names.

Now, choose Replace from the Data main menu.

The sample iterates through all data rows of the loaded XML data source. If a BarcodeFrame matches the Name column in the data row, the value is applied to the barcode.


Implementing a custom barcode dialog

This sample shows how to implement a custom barcode dialog by using the most common properties of TX Barcode .NET.

The source code is contained in the following directories:

  • Samples\WPF\CSharp\Simple
  • Samples\WPF\VB.NET\Simple

Implementing a custom barcode dialog

This sample should show how to use the most commonly used properties of TX Barcode .NET. To outline a typical scenario, a custom dialog has been implemented to adjust the barcode type, the text, color and rotation.

Open the sample project in Visual Studio and start it. The dialog uses a TXBarcodeControl to preview the adjusted settings. When changing the Barcode Type, you will recognize that the default Text and the Upper Text Length is changed automatically.

Each type has it's own constraints such as a minimum or maximum text length. This sample dialog implements the validation of these constraints using the available methods.

An example: If the Text is changed, the GetMinimumTextLength property is used to compare whether the new text length is larger than this minimum length.

Additionally, the IsTextValid method is used to check the validity of the new text. Specific constraints could be the usage of numeric values only or only a specific collection of alphanumeric values.

[C#]
private void textBox1_TextChanged(object sender, EventArgs e)
{
    if (textBox1.Text.Length < TXTextControl.WPF.Barcode.TXBarcodeControl.GetMinimumTextLength(txBarcodeControl1.BarcodeType))
        return;

    string sError;

    if (TXTextControl.WPF.Barcode.TXBarcodeControl.IsTextValid(txBarcodeControl1.BarcodeType, textBox1.Text, out sError) == true)
        txBarcodeControl1.Text = textBox1.Text;
    else
        MessageBox.Show(sError);
}

You can change the Barcode Fore Color and the Barcode Back Color as well as the Angle between 0 and 360 degrees and the alignment of the barcode in it's control panel.


Resource Kit

This chapter shows how to use the resource kit that enables developers to display TX Barcode .NET's user interface parts in languages other than English and German.

Resource Kit


Resource Kit

TX Barcode .NET offers a Resource Kit that enables developers to display TX Barcode .NET's user interface parts in languages other than English and German. English and German are the built-in resources and cannot be changed. All other languages are possible with the satellite assembly mechanism the prefered mechanism for localization within the .NET Framework. The following describes how to build a satellite assembly.

TX Barcode .NET Resources

Resource Kit Files

Building the Satellite Assembly

Installing the Satellite Assembly


TX Barcode .NET Resources

TX Barcode .NET has built-in dialog boxes and error strings. The language used for the parts of the .NET Framework depend on the current system language. Therefore, the built-in TX Barcode .NET resources follow this mechanism and also depend on the current system language. For example, if a developer builds a satellite assembly for French, the French resources are only loaded if the current system language is also French.


Resource Kit Files

The ResourceKit directory, which is a subdirectory of your TX Barcode .NET main installation directory, contains all necessary files. The TXBarcode.resx file contains all built-in resources in a human readable XML format. All parts of dialog boxes appear as strings.

The buildres.bat file is a command line batch file that calls the command line tools of the .NET Framework SDK necessary to build the satellite assembly.

The txtextcontrol.public.snk file contains Text Control's public key also necessary to build the satellite assembly.


Building the Satellite Assembly

To build a satellite assembly for TX Barcode .NET, perform the following tasks:

1. Install at least the .NET Framework SDK.

2. Translate all the text resources in the TXBarcode.resx file. The text resources are the contents of the value tags.

3. Call the buildres.bat batch file with the two letter language code specified through ISO 639 as parameter (for example French: buildres fr). The batch process builds the satellite assembly file TXBarcode.resources.dll.


Installing the Satellite Assembly

The newly created assembly must be located in a subdirectory of your application's installation directory, which must contain all necessary TX Barcode .NET files. The name of the subdirectory must be the two letter language code. For example to install a French satellite assembly create a subdirectory fr and copy TXBarcode.resources.dll to this directory.

Additionally, create the following registry key to ensure that the .NET Framework uses custom builds of satellite assemblies with your application:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\TXBarcode.resources,6B83FE9A75CFB638]


Distributing your Applications

This chapter lists the TX Barcode .NET files that must be deployed with your applications.

Redistributable Files


Redistributable Files

You must ensure that all necessary files exist on your client's machine. The files in the following lists can be found in the \Assembly folder of your TX Barcode .NET installation directory.

For a Windows Forms or a WPF application all necessary files must be copied into the same folder as your application's executable program file. When deploying an ASP.NET application, these files must be copied into the ASP.NET Bin folder.

TX Barcode .NET Windows Forms Components (\Assembly subdirectory):

  • TXBarcode.Windows.Forms.dll (2.0.100.500)

TX Barcode .NET WPF Components (\Assembly subdirectory):

  • TXBarcode.WPF.dll (2.0.100.500)

TX Barcode .NET core assembly (\Assembly subdirectory):

  • TXBarcode.dll (2.0.100.500)


Class Library Reference

The TX Barcode .NET class library in detail and alphabetical order.

Barcode.TXBarcodeControl Class

Enumerations

WPF.Barcode.TXBarcodeControl Class


Barcode.TXBarcodeControl Class

The TXBarcodeControl class provides properties to specify type and format of barcodes rendered in Windows Forms.

Syntax

[C#]
public sealed class TXBarcodeControl
[Visual Basic]
Public NotInheritable Class TXBarcodeControl

Constructors

Constructor | Description
Barcode.TXBarcodeControl | Initializes a new instance of the TXBarcodeControl class.

Properties

Property | Description
Alignment | Gets or sets the alignment of the barcode image inside the control.
Angle | Gets or sets the angle of the barcode image inside the control.
BackColor | Gets or sets the background color for the barcode control.
BarcodeType | Gets or sets the type of barcode that is rendered.
ForeColor | Gets or sets the foreground color for the barcode.
ShowText | Gets or sets a value indicating whether the barcode text is displayed under the barcode image or not.
Text | Gets or sets the text the barcode should encrypt.
UpperTextLength | Gets or sets the maximum number of characters the Text property can get.

Methods

Method | Description
GetDefaultText | Returns the default text for the specified barcode type.
GetMaximumTextLength | Returns the maximum text length of the specified barcode type.
GetMinimumTextLength | Returns the minimum text length of the specified barcode type.
IsTextValid | Returns a value indicating whether the specified text is valid for a specific barcode type.
Load | Overloaded. Loads barcode data into the control.
PrintPaint | Draws the barcode on the specified System.Drawing.Graphics object.
Save | Overloaded. Saves the barcode data.
SaveImage | Overloaded. Saves the barcode image.


Barcode.TXBarcodeControl Constructor

Initializes a new instance of the TXBarcodeControl class.

Syntax

[C#]
public TXBarcodeControl();
[Visual Basic]
Public Sub New()


Barcode.TXBarcodeControl.Alignment Property

Gets or sets the alignment of the barcode image inside the control. The default value is TXTextControl.Barcode.Alignment.MiddleCenter.

Syntax

[C#]
public TXTextControl.Barcode.Alignment Alignment{ get; set; }
[Visual Basic]
Public Property Alignment() As TXTextControl.Barcode.Alignment


Barcode.TXBarcodeControl.Angle Property

Gets or sets the angle of the barcode image inside the control. The default value is 0.

Syntax

[C#]
public int Angle{ get; set; }
[Visual Basic]
Public Property Angle() As Integer


Barcode.TXBarcodeControl.BackColor Property

Gets or sets the background color for the barcode control. The default color is System.Drawing.SystemColors.Window.

Syntax

[C#]
public System.Drawing.Color BackColor{ get; set; }
[Visual Basic]
Public Property BackColor() As System.Drawing.Color


Barcode.TXBarcodeControl.BarcodeType Property

Gets or sets the type of barcode that is rendered.

Syntax

[C#]
public TXTextControl.Barcode.BarcodeType BarcodeType{ get; set; }
[Visual Basic]
Public Property BarcodeType() As TXTextControl.Barcode.BarcodeType

Remarks

On changing this property all control settings are retained, if they are valid for the conditions of the new barcode type. Otherwise, the Text and UpperTextLength properties are reset to the default values of the new barcode type.


Barcode.TXBarcodeControl.ForeColor Property

Gets or sets the foreground color for the barcode. The default color is System.Drawing.SystemColors.WindowText.

Syntax

[C#]
public System.Drawing.Color ForeColor{ get; set; }
[Visual Basic]
Public Property ForeColor() As System.Drawing.Color


Barcode.TXBarcodeControl.GetDefaultText Method

Returns the default text for the specified barcode type.

Syntax

[C#]
public static string GetDefaultText(TXTextControl.Barcode.BarcodeType barcodeType);
[Visual Basic]
Public Shared Function GetDefaultText(ByVal barcodeType As TXTextControl.Barcode.BarcodeType) As String
Parameter | Description
barcodeType | Specifies the barcode type whose default text is returned.

Return Value

The default text for the specified barcode type.


Barcode.TXBarcodeControl.GetMaximumTextLength Method

Returns the maximum text length of the specified barcode type.

Syntax

[C#]
public static int GetMaximumTextLength(TXTextControl.Barcode.BarcodeType barcodeType);
[Visual Basic]
Public Shared Function GetMaximumTextLength(ByVal barcodeType As TXTextControl.Barcode.BarcodeType) As Integer
Parameter | Description
barcodeType | Specifies the barcode type whose maximum text length is returned.

Return Value

The maximum text length for the specified barcode type.


Barcode.TXBarcodeControl.GetMinimumTextLength Method

Returns the minimum text length of the specified barcode type.

Syntax

[C#]
public static int GetMinimumTextLength(TXTextControl.Barcode.BarcodeType barcodeType);
[Visual Basic]
Public Shared Function GetMinimumTextLength(ByVal barcodeType As TXTextControl.Barcode.BarcodeType) As Integer
Parameter | Description
barcodeType | Specifies the barcode type whose minimum text length is returned.

Return Value

The minimum text length for the specified barcode type.


Barcode.TXBarcodeControl.IsTextValid Method

Returns 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.

Syntax

[C#]
public static bool IsTextValid(TXTextControl.Barcode.BarcodeType barcodeType, string text, out string errorMessage);
[Visual Basic]
Public Shared Function IsTextValid(ByVal barcodeType As TXTextControl.Barcode.BarcodeType, ByVal text As String, ByRef errorMessage As String) As Boolean
Parameter | Description
barcodeType | Specifies the barcode type whose text is checked.
text | Specifies the text to check.
errorMessage | Specifies the string, an appropriate exception message is saved to, if the checked text is not valid for a specific barcode type.

Return Value

True, if the specified text is valid for a specific barcode type. Otherwise false.


Barcode.TXBarcodeControl.Load Method

Loads barcode data into the control.

Load(String)

Loads barcode data into the control from a specified file. The data format must be XML.

[C#]
public void Load(string fileName);
[Visual Basic]
Public Sub Load(ByVal fileName As String)
Parameter | Description
fileName | Specifies a file the data is loaded from.

Load(String, SerializationFormat)

Loads barcode data into the control with the specified format. The new barcode is read from the specified file.

[C#]
public void Load(string fileName, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Load(ByVal fileName As String, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
fileName | Specifies a file the data is loaded from.
format | Specifies the format used to deserialize the barcode.

Load(Stream)

Loads barcode data into the control from a specified object of type System.IO.Stream. The data format must be XML.

[C#]
public void Load(System.IO.Stream stream);
[Visual Basic]
Public Sub Load(ByVal stream As System.IO.Stream)
Parameter | Description
stream | Specifies an object of type System.IO.Stream the data is loaded from. The data is loaded from the stream's current position.

Load(Stream, SerializationFormat)

Loads barcode data into the control with the specified format. The new barcode is read from the specified object of type System.IO.Stream.

[C#]
public void Load(System.IO.Stream stream, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Load(ByVal stream As System.IO.Stream, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
stream | Specifies an object of type System.IO.Stream the data is loaded from. The data is loaded from the stream's current position.
format | Specifies the format used to deserialize the barcode.

Load(TextReader)

Loads barcode data into the control from a specified object of type System.IO.TextReader. The data format must be XML.

[C#]
public void Load(System.IO.TextReader textReader);
[Visual Basic]
Public Sub Load(ByVal textReader As System.IO.TextReader)
Parameter | Description
textReader | Specifies an object of type System.IO.TextReader the data is loaded from.

Load(XmlReader)

Loads barcode data into the control from a specified object of type System.Xml.XmlReader. The data format must be XML.

[C#]
public void Load(System.Xml.XmlReader xmlReader);
[Visual Basic]
Public Sub Load(ByVal xmlReader As System.Xml.XmlReader)
Parameter | Description
xmlReader | Specifies an object of type System.IO.XmlReader the data is loaded from.


Barcode.TXBarcodeControl.PrintPaint Method

Draws the barcode on the specified System.Drawing.Graphics object.

Syntax

[C#]
public void PrintPaint(System.Drawing.Graphics graphics, System.Drawing.Rectangle position);
[Visual Basic]
Public Sub PrintPaint(ByVal graphics As System.Drawing.Graphics, ByVal position As System.Drawing.Rectangle)
Parameter | Description
graphics | Specifies the object of type System.Drawing.Graphics the barcode is printed to.
position | Specifies the position to draw on the specified System.Drawing.Graphics object.


Barcode.TXBarcodeControl.Save Method

Saves the barcode data.

Save(String)

Saves the barcode data to the given file. The data format of the file is XML.

[C#]
public void Save(string fileName);
[Visual Basic]
Public Sub Save(ByVal fileName As String)
Parameter | Description
fileName | Specifies a file the is saved to.

Save(String, SerializationFormat)

Saves the barcode data to the specified file using the specified format.

[C#]
public void Save(string fileName, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Save(ByVal fileName As String, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
fileName | Specifies a file the is saved to.
format | Specifies the format used to serialize the barcode.

Save(Stream)

Saves the barcode data to the given object of type System.IO.Stream. The data format of the stream is XML.

[C#]
public void Save(System.IO.Stream stream);
[Visual Basic]
Public Sub Save(ByVal stream As System.IO.Stream)
Parameter | Description
stream | Specifies an object of type System.IO.Stream the data is saved to.

Save(Stream, SerializationFormat)

Saves the barcode data to the specified object of type System.IO.Stream using the specified format.

[C#]
public void Save(System.IO.Stream stream, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Save(ByVal stream As System.IO.Stream, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
stream | Specifies an object of type System.IO.Stream the data is saved to.
format | Specifies the format used to serialize the barcode.

Save(TextWriter)

Saves the barcode data to the given object of type System.IO.TextWriter. The data format of the stream is XML.

[C#]
public void Save(System.IO.TextWriter textWriter);
[Visual Basic]
Public Sub Save(ByVal textWriter As System.IO.TextWriter)
Parameter | Description
textWriter | Specifies an object of type System.IO.TextWriter the data is saved to.

Save(XmlWriter)

Saves the barcode data to the given object of type System.IO.XmlWriter. The data format of the stream is XML.

[C#]
public void Save(System.Xml.XmlWriter xmlWriter);
[Visual Basic]
Public Sub Save(ByVal xmlWriter As System.Xml.XmlWriter)
Parameter | Description
xmlWriter | Specifies an object of type System.IO.XmlWriter the data is saved to.


Barcode.TXBarcodeControl.SaveImage Method

Saves the barcode image.

SaveImage(Stream, ImageFormat)

Saves the barcode image to the specified object of type System.IO.Stream.

[C#]
public void SaveImage(System.IO.Stream imageStream, System.Drawing.Imaging.ImageFormat format);
[Visual Basic]
Public Sub SaveImage(ByVal imageStream As System.IO.Stream, ByVal format As System.Drawing.Imaging.ImageFormat)
Parameter | Description
imageStream | Specifies an object of type System.IO.Stream the image is saved to.
format | Specifies the format used to save the image.

SaveImage(String, ImageFormat)

Saves the barcode image to the specified file using the specified format.

[C#]
public void SaveImage(string imageFileName, System.Drawing.Imaging.ImageFormat format);
[Visual Basic]
ublic Sub SaveImage(ByVal imageFileName As String, ByVal format As System.Drawing.Imaging.ImageFormat)
Parameter | Description
imageFileName | Specifies a file the image is saved to.
format | Specifies the format used to save the image.


Barcode.TXBarcodeControl.ShowText Property

Gets or sets a value indicating whether the barcode text is displayed under the barcode image or not. The default value is true.

Syntax

[C#]
public bool ShowText{ get; set; }
[Visual Basic]
Public Property ShowText() As Boolean

Remarks

This property is only executable for one dimensional barcodes.


Barcode.TXBarcodeControl.Text Property

Gets or sets the text the barcode should encrypt.

Syntax

[C#]
public string Text{ get; set; }
[Visual Basic]
Public Property Text() As String

Remarks

Throws an ArgumentException, if the value is not valid for the conditions of the current barcode type.


Barcode.TXBarcodeControl.UpperTextLength Property

Gets or sets the maximum number of characters the Text property can get.

Syntax

[C#]
public int UpperTextLength{ get; set; }
[Visual Basic]
Public Property UpperTextLength() As Integer

Remarks

Throws an ArgumentException, if the value is not valid for the conditions of the current barcode type.


Enumerations

Barcode.Alignment Enumeration

Barcode.BarcodeType Enumeration

WPF.Barcode.ImageFormat Enumeration

Barcode.SerializationFormat Enumeration


Barcode.Alignment Enumeration

Determines the alignment of the barcode image inside the control. The enumeration contains the following values:

Member | Description
BottomCenter | Sets the alignment of the image to the bottom center of the control.
BottomLeft | Sets the alignment of the image to the bottom left of the control.
BottomRight | Sets the alignment of the image to the bottom right of the control.
MiddleCenter | Sets the alignment of the image to the middle center of the control.
MiddleLeft | Sets the alignment of the image to the middle left of the control.
MiddleRight | Sets the alignment of the image to the middle right of the control.
TopCenter | Sets the alignment of the image to the top center of the control.
TopLeft | Sets the alignment of the image to the top left of the control.
TopRight | Sets the alignment of the image to the top right of the control.


Barcode.BarcodeType Enumeration

Determines the type of barcode that is created by TX Barcode. The enumeration contains the following values:

Member | Description
Code128 | Code128 is an alphanumeric barcode with high information density.
Interleaved2of5 | 2 of 5 is a barcode that encrypts digits only.
Code39 | 3 of 9 is a barcode that encrypts alphanumeric values.
AztecCode | AztecCode is a two-dimensional barcode that encrypts up to 1300 ASCII values.
IntelligentMail | Intelligent Mail barcode is a barcode type that encrypts postal zip codes and it the successor of Postnet.
EAN13 | EAN 13 encrypts 13 digits and is used for marking retail goods.
EAN8 | EAN 8 is derived from barcode type EAN13 and encrypts 8 digits.
UPCA | UPC-A barcode encrypts 12 digits and is very similar to EAN 13.
Postnet | Postnet is a barcode type that encrypts postal zip codes.
QRCode | QR Code is a two-dimensional barcode that encrypts up to 1270 ASCII values or 1850 alphanumeric values. By design TX Barcode switches encryption mode when necessary.
Datamatrix | Datamatrix is a two-dimensional barcode that encrypts up to 1301 ASCII values.


WPF.Barcode.ImageFormat Enumeration

Specifies the format of the image in WPF. The enumeration contains the following values:

Member | Description
BMP | Specifies the bitmap (BMP) image format.
JPEG | Specifies the Joint Photographic Experts Group (JPEG) image format.
PNG | Specifies the W3C Portable Network Graphics (PNG) image format.
TIFF | Specifies the Tagged Image File Format (TIFF) image format.
GIF | Specifies the Graphics Interchange Format (GIF) image format.
WMP | Specifies the Microsoft Windows Media Photo (WMP) image format.


Barcode.SerializationFormat Enumeration

Determines the formatting type for the barcode serialization. The enumeration contains the following values:

Member | Description
Xml | Barcode data is serialized using well-formed XML.
Binary | Barcode data is serialized in a binary format.


WPF.Barcode.TXBarcodeControl Class

The TXBarcodeControl class provides properties to define type and format of the barcode it displays in WPF.

Syntax

[C#]
public sealed class TXBarcodeControl
[Visual Basic]
Public NotInheritable Class TXBarcodeControl

Constructors

Constructor | Description
WPF.Barcode.TXBarcodeControl | Initializes a new instance of the TXBarcodeControl class.

Properties

Property | Description
Alignment | Gets or sets the alignment of the barcode image inside the control.
Angle | Gets or sets the angle of the barcode image inside the control.
BackColor | Gets or sets the background color for the barcode control.
BarcodeType | Gets or sets the type of barcode that should be displayed.
ForeColor | Gets or sets the foreground color for the barcode.
ShowText | Gets or sets a value indicating whether the barcode text is displayed under the barcode image or not.
Text | Gets or sets the text the barcode should encrypt.
UpperTextLength | Gets or sets the maximum number of characters the Text property can have.

Methods

Method | Description
GetDefaultText | Returns the default text for the specified barcode type.
GetMaximumTextLength | Returns the maximum text length the specified barcode type can have.
GetMinimumTextLength | Returns the minimum text length the specified barcode type can have.
IsTextValid | Returns a value whether the specified text is valid for a specific barcode type.
Load | Overloaded. Loads barcode data into the control.
PrintPaint | Overloaded. Draws the barcode on a specific object of type System.Drawing.Graphics or System.Windows.Media.DrawingContext with specified bounds or stretch factor.
Save | Overloaded. Saves the barcode data.
SaveImage | Overloaded. Saves the barcode image.


WPF.Barcode.TXBarcodeControl Constructor

Initializes a new instance of the TXBarcodeControl class.

Syntax

[C#]
public TXBarcodeControl();
[Visual Basic]
Public Sub New()


WPF.Barcode.TXBarcodeControl.Alignment Property

Gets or sets the alignment of the barcode image inside the control. The default value is TXTextControl.Barcode.Alignment.MiddleCenter.

Syntax

[C#]
public TXTextControl.Barcode.Alignment Alignment{ get; set; }
[Visual Basic]
Public Property Alignment() As TXTextControl.Barcode.Alignment


WPF.Barcode.TXBarcodeControl.Angle Property

Gets or sets the angle of the barcode image inside the control. The default value is 0.

Syntax

[C#]
public int Angle{ get; set; }
[Visual Basic]
Public Property Angle() As Integer


WPF.Barcode.TXBarcodeControl.BackColor Property

Gets or sets the background color for the barcode control. The default value is null and represents the color SystemColors.WindowColor.

Syntax

[C#]
public System.Windows.Media.Color? BackColor{ get; set; }
[Visual Basic]
Public Property BackColor() As Nullable(Of System.Windows.Media.Color)


WPF.Barcode.TXBarcodeControl.BarcodeType Property

Gets or sets the type of barcode that should be displayed. This is a dependency property.

Syntax

[C#]
public TXTextControl.Barcode.BarcodeType BarcodeType{ get; set; }
[Visual Basic]
Public Property BarcodeType() As TXTextControl.Barcode.BarcodeType

Remarks

On changing this property all control settings are retained, if they are valid for the conditions of the new barcode type. Otherwise the Text and UpperTextLength properties are reset to the default values of the new barcode type.


WPF.Barcode.TXBarcodeControl.ForeColor Property

Gets or sets the foreground color for the barcode. The default value is null and represents the color SystemColors.WindowTextColor.

Syntax

[C#]
public System.Windows.Media.Color? ForeColor{ get; set; }
[Visual Basic]
Public Property ForeColor() As Nullable(Of System.Windows.Media.Color)


WPF.Barcode.TXBarcodeControl.GetDefaultText Method

Returns the default text for the specified barcode type.

Syntax

[C#]
public static string GetDefaultText(TXTextControl.Barcode.BarcodeType barcodeType);
[Visual Basic]
Public Shared Function GetDefaultText(ByVal barcodeType As TXTextControl.Barcode.BarcodeType) As String
Parameter | Description
barcodeType | Specifies the barcode type for which the default text is returned.

Return Value

The default text for the specified barcode type.


WPF.Barcode.TXBarcodeControl.GetMaximumTextLength Method

Returns the maximum text length the specified barcode type can have.

Syntax

[C#]
public static int GetMaximumTextLength(TXTextControl.Barcode.BarcodeType barcodeType);
[Visual Basic]
Public Shared Function GetMaximumTextLength(ByVal barcodeType As TXTextControl.Barcode.BarcodeType) As Integer
Parameter | Description
barcodeType | Specifies the barcode type for which the maximum text length is returned.

Return Value

The maximum text length for the specified barcode type.


WPF.Barcode.TXBarcodeControl.GetMinimumTextLength Method

Returns the minimum text length the specified barcode type can have.

Syntax

[C#]
public static int GetMinimumTextLength(TXTextControl.Barcode.BarcodeType barcodeType);
[Visual Basic]
Public Shared Function GetMinimumTextLength(ByVal barcodeType As TXTextControl.Barcode.BarcodeType) As Integer
Parameter | Description
barcodeType | Specifies the barcode type for which the minimum text length is returned.

Return Value

The minimum text length for the specified barcode type.


WPF.Barcode.TXBarcodeControl.IsTextValid Method

Returns 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.

Syntax

[C#]
public static bool IsTextValid(TXTextControl.Barcode.BarcodeType barcodeType, string text, out string errorMessage);
[Visual Basic]
Public Shared Function IsTextValid(ByVal barcodeType As TXTextControl.Barcode.BarcodeType, ByVal text As String, ByRef errorMessage As String) As Boolean
Parameter | Description
barcodeType | Specifies the barcode type for which the text is checked.
text | Specifies the text to check.
errorMessage | Specifies the string into which an appropriate exception message is saved, if the checked text is not valid for a specific barcode type.

Return Value

True, if the specified text is valid for a specific barcode type. Otherwise false.


WPF.Barcode.TXBarcodeControl.Load Method

Loads barcode data into the control.

Load(String)

Loads barcode data into the control from a specified file. The data format must be XML.

[C#]
public void Load(string fileName);
[Visual Basic]
Public Sub Load(ByVal fileName As String)
Parameter | Description
fileName | Specifies a file from which the data is loaded.

Load(String, SerializationFormat)

Loads barcode data into the control with the specified format. The new barcode is read from the specified file.

[C#]
public void Load(string fileName, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Load(ByVal fileName As String, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
fileName | Specifies a file from which the data is loaded.
format | Specifies the format used to deserialize the barcode.

Load(Stream)

Loads barcode data into the control from a specified object of type System.IO.Stream. The data format must be XML.

[C#]
public void Load(System.IO.Stream stream);
[Visual Basic]
Public Sub Load(ByVal stream As System.IO.Stream)
Parameter | Description
stream | Specifies an object of type System.IO.Stream from which the data is loaded. The data is loaded from the stream's current position.

Load(Stream, SerializationFormat)

Loads barcode data into the control with the specified format. The new barcode is read from the specified object of type System.IO.Stream.

[C#]
public void Load(System.IO.Stream stream, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Load(ByVal stream As System.IO.Stream, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
stream | Specifies an object of type System.IO.Stream from which the data is loaded. The data is loaded from the stream's current position.
format | Specifies the format used to deserialize the barcode.

Load(TextReader)

Loads barcode data into the control from a specified object of type System.IO.TextReader. The data format must be XML.

[C#]
public void Load(System.IO.TextReader textReader);
[Visual Basic]
Public Sub Load(ByVal textReader As System.IO.TextReader)
Parameter | Description
textReader | Specifies an object of type System.IO.TextReader from which the data is loaded.

Load(XmlReader)

Loads barcode data into the control from a specified object of type System.Xml.XmlReader. The data format must be XML.

[C#]
public void Load(System.Xml.XmlReader xmlReader);
[Visual Basic]
Public Sub Load(ByVal xmlReader As System.Xml.XmlReader)
Parameter | Description
xmlReader | Specifies an object of type System.IO.XmlReader from which the data is loaded.


WPF.Barcode.TXBarcodeControl.PrintPaint Method

Draws the barcode on a specific object of type System.Drawing.Graphics or System.Windows.Media.DrawingContext with specified bounds or stretch factor.

PrintPaint(Object, Object)

Draws the barcode on a specific object of type System.Drawing.Graphics with the specified bounds. The parameter position must be an object of type System.Drawing.Rectangle.

[C#]
public void PrintPaint(object graphics, object position);
[Visual Basic]
Public Sub PrintPaint(ByVal graphics As Object, ByVal position As Object)
Parameter | Description
graphics | Specifies the object of type System.Drawing.Graphics on which the barcode is drawn.
position | Specifies the position to draw on the specified object of type System.Drawing.Graphics.

PrintPaint(DrawingContext, Double)

Draws the barcode on a specific object of type System.Windows.Media.DrawingContext with the specified stretch factor.

[C#]
public void PrintPaint(System.Windows.Media.DrawingContext drawingContext, double stretchFactor);
[Visual Basic]
Public Sub PrintPaint(drawingContext As System.Windows.Media.DrawingContext, stretchFactor as Double)
Parameter | Description
drawingContext | Specifies the object of type System.Windows.Media.DrawingContext on which the barcode is drawn.
stretchFactor | Specifies the stretch factor to draw on the specified object of type System.Windows.Media.DrawingContext.


WPF.Barcode.TXBarcodeControl.Save Method

Saves the barcode data.

Save(String)

Saves the barcode data to the given file. The data format of the file is XML.

[C#]
public void Save(string fileName);
[Visual Basic]
Public Sub Save(ByVal fileName As String)
Parameter | Description
fileName | Specifies a file into which the data is saved.

Save(String, SerializationFormat)

Saves the barcode data into the specified file with the specified format.

[C#]
public void Save(string fileName, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Save(ByVal fileName As String, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
fileName | Specifies a file into which the data is saved.
format | Specifies the format used to serialize the barcode.

Save(Stream)

Saves the barcode data to the given object of type System.IO.Stream. The data format of the stream is XML.

[C#]
public void Save(System.IO.Stream stream);
[Visual Basic]
Public Sub Save(ByVal stream As System.IO.Stream)
Parameter | Description
stream | Specifies an object of type System.IO.Stream into which the data is saved.

Save(Stream, SerializationFormat)

Saves the barcode data into the specified object of type System.IO.Stream with the specified format.

[C#]
public void Save(System.IO.Stream stream, TXTextControl.Barcode.SerializationFormat format);
[Visual Basic]
Public Sub Save(ByVal stream As System.IO.Stream, ByVal format As TXTextControl.Barcode.SerializationFormat)
Parameter | Description
stream | Specifies an object of type System.IO.Stream into which the data is saved.
format | Specifies the format used to serialize the barcode.

Save(TextWriter)

Saves the barcode data to the given object of type System.IO.TextWriter. The data format of the stream is XML.

[C#]
public void Save(System.IO.TextWriter textWriter);
[Visual Basic]
Public Sub Save(ByVal textWriter As System.IO.TextWriter)
Parameter | Description
textWriter | Specifies an object of type System.IO.TextWriter into which the data is saved.

Save(XmlWriter)

Saves the barcode data to the given object of type System.IO.XmlWriter. The data format of the stream is XML.

[C#]
public void Save(System.Xml.XmlWriter xmlWriter);
[Visual Basic]
Public Sub Save(ByVal xmlWriter As System.Xml.XmlWriter)
Parameter | Description
xmlWriter | Specifies an object of type System.IO.XmlWriter into which the data is saved.


WPF.Barcode.TXBarcodeControl.SaveImage Method

Saves the barcode image.

SaveImage(Stream, ImageFormat)

Saves the barcode image to the specified object of type System.IO.Stream with the specified format of type System.Drawing.Imaging.ImageFormat.

[C#]
public void SaveImage(System.IO.Stream imageStream, System.Drawing.Imaging.ImageFormat format);
[Visual Basic]
Public Sub SaveImage(ByVal imageStream As System.IO.Stream, ByVal format As System.Drawing.Imaging.ImageFormat)
Parameter | Description
imageStream | Specifies an object of type System.IO.Stream into which the image is saved.
format | Specifies the format used to save the image.

SaveImage(String, ImageFormat)

Saves the barcode image into the specified file with the specified format of type System.Drawing.Imaging.ImageFormat.

[C#]
public void SaveImage(string imageFileName, System.Drawing.Imaging.ImageFormat format);
[Visual Basic]
Public Sub SaveImage(ByVal imageFileName As String, ByVal format As System.Drawing.Imaging.ImageFormat)
Parameter | Description
imageFileName | Specifies a file into which the image is saved.
format | Specifies the format used to save the image.

SaveImage(Stream, ImageFormat)

Saves the barcode image to the specified object of type System.IO.Stream with the specified format of type TXTextControl.WPF.Barcode.ImageFormat.

[C#]
public void SaveImage(System.IO.Stream imageStream, TXTextControl.WPF.Barcode.ImageFormat format);
[Visual Basic]
Public Sub SaveImage(ByVal imageStream As System.IO.Stream, ByVal format As TXTextControl.WPF.Barcode.ImageFormat)
Parameter | Description
imageStream | Specifies an object of type System.IO.Stream into which the image is saved.
format | Specifies the format used to save the image.

SaveImage(String, ImageFormat)

Saves the barcode image into the specified file with the specified format of type TXTextControl.WPF.Barcode.ImageFormat.

[C#]
public void SaveImage(string imageFileName, TXTextControl.WPF.Barcode.ImageFormat format);
[Visual Basic]
Public Sub SaveImage(ByVal imageFileName As String, ByVal format As TXTextControl.WPF.Barcode.ImageFormat)
Parameter | Description
imageFileName | Specifies a file into which the image is saved.
format | Specifies the format used to save the image.


WPF.Barcode.TXBarcodeControl.ShowText Property

Gets or sets a value indicating whether the barcode text is displayed under the barcode image or not. The default value is true.

Syntax

[C#]
public bool ShowText{ get; set; }
[Visual Basic]
Public Property ShowText() As Boolean

Remarks

This property is only executable for one dimensional barcodes.


WPF.Barcode.TXBarcodeControl.Text Property

Gets or sets the text the barcode should encrypt. This is a dependency property.

Syntax

[C#]
public string Text{ get; set; }
[Visual Basic]
Public Property Text() As String

Remarks

Throws an ArgumentException, if the value is not valid for the conditions of the current barcode type.


WPF.Barcode.TXBarcodeControl.UpperTextLength Property

Gets or sets the maximum number of characters the Text property can have. This is a dependency property.

Syntax

[C#]
public int UpperTextLength{ get; set; }
[Visual Basic]
Public Property UpperTextLength() As Integer

Remarks

Throws an ArgumentException, if the value is not valid for the conditions of the current barcode type.