Version

Adding Barcode In Code-Behind

Before You Begin

This topic is designed to get you up and running as quickly as possible by describing the basic steps required for adding a UltraCode128Barcode™ control to your application.

What You Will Accomplish

You will add a basic UltraCode128Barcode control to your application.

Follow these Steps

  1. Create a Windows Forms application.

  2. Add the following references to your project:

    • Infragistics4.Win.DataVisualization.Barcode

    • Infragistics4.Win.DataVisualization.Shared

    • Infragistics4.Win.Portable.Core

  1. Add the following namespaces in the application.

In Visual Basic:

Imports Infragistics.Win.DataVisualization

In C#:

using Infragistics.Win.DataVisualization;
  1. Choose a barcode symbology.

Note: Each barcode symbology is a separate control.

UltraBarcode Symbology Types:

In Visual Basic:

Dim Barcode As New UltraCode128Barcode()

In C#:

var Barcode = new UltraCode128Barcode();
  1. Assign a value to the control’s Data property

In Visual Basic:

Barcode.Data = "Code128"

In C#:

Barcode.Data = "Code128";
  1. Add the instance of conrol to the main view.

In Visual Basic:

this.Controls.Add(Barcode)

In C#:

this.Controls.Add(Barcode);
  1. Save and run your application.

xamBarcode Adding Code128 01.png