.NET Windows Forms Barcode Control is a professional and easy-to-use barcode generator for any .NET development environments that are compatible with customizing WinForms DLL or Control. It supports Visual C#, Visual Basic, Managed C++, Borland Delphi for .NET and Visual Studio 2005/2008/2010. This smart barcode control export barcodes as graphic images, instead of fonts, to a barcode printer or an image file.
Unlike common barcode fonts, this barcode generationg control calculates checksum digits automatically while creating barcodes in .NET Windows Forms applications. And you are also allowed to change the barcode size and many other barcode properties as your specific requirements using this .NET WinForms barcoding control. It supports creating over 20 most common linear and two dimensional barcode symbologies.
.NET Windows Forms Barcode Generator Control & DLL
supports generating most common linear (1d) and matrix (2d) bar code standards, including:
- 2D Barcodes: Data Matrix, PDF-417 and QR-Code.
- Alphanumeric Barcodes: Code-39, Code-93, Code-128 and GS1-128/UCC/EAN-128.
- UPC / EAN Barcodes: EAN-8, EAN-13, ISBN, ISSN, UPC-A and UPC-E.
- Numeric Barcodes: Identcode, Leitcode, Codabar and Code-11.
- Code 2 of 5 based Barcodes: Code 2 of 5, Interleaved 2 of 5 and ITF-14.
- Postal Barcodes: POSTNET, PLANET, USPS Intelligent Mail Barcode (OneCode), RM4SCC and MSI Plessey.
The following article shows you how to generate barcodes in Window Forms applications in Visual Studio by using our barcode tool.
Tutorial - Install .NET WinForms Barcoding SDK into Visual Studio
- Download the Barcode SDK for .NET Windows Forms from the right top Down link
- Extract the barcode files from the package and Copy the KeepDynamic.BarCode.Windows.dll file to your project directory. The .NET build tools will automatically put the barcode DLL file into an appropriate bin directory
- Start your Visual Studio and open the project/solution that you are going to add barcode generating features
- Display the form where barcodes will be created and right click the Toolbox, select Choose Items
- Select .NET Framework Components, Hit Browse at the right lower side of the Window
- Choose the KeepDynamic.BarCode.Windows.dll file under the project directory
- Then four barcode items will appear in your Toolbox. They are BarCodeControl, QRCodeControl, DataMatrixControl, and PDF417Control
- In addition, you can also install the barcode tool via selecting Project: Add Reference
How to Create Barcodes in Windows Forms Applications?
To create linear & 2D barcodes in Windows Forms applications, do the following procedures:
- Add KeepDynamic.BarCode.Windows.dll to your C#, VB.NET project reference.
- Add KeepDynamic.BarCode.Windows.dll to windows project toolbox.
- Drag one of the BarCodeControl, DataMatrixControl, PDF417Control, QRCodeControl item to your windows forms. To generate linear barcode symbologies, such as Code 3 of 9, Code 128, GS1-128, UPC/EAN as well as IM barcode, Postnet, RM4SCC, please drag and drop the tool BarCodeControl to your .NET WinForms Project. To create matrix(2D) barcodes, like QR Code, Data Matrix and PDF417, please drag and drop the corresponding barcode control( QRCodeControl, DataMatrixControl, and PDF417Control) to your .NET project.
How to Generate Barcodes in WinForms using C# Class
The following C# .NET code illustrates how to generate a barcode in C# class:
// Create linear barcode object in C#
BarCode barcode = new BarCode();
// Set barcode symbology type to Code-39 in C#
barcode.SymbologyType = SymbologyType.Code39;
// Set Code39 barcode value in C#
barcode.CodeText = "CODE39";
// Set Code39 drawing image format to PNG in C#
barcode.Format = System.Drawing.Imaging.ImageFormat.Png;
// Generate Code-39 barcode & encode to the png image in C#
// other barcode outputting ways:
// output generated barcode to byte array
byte barcodeInBytes = barcode.drawBarcodeAsBytes();
// output generated barcode to Graphics object
Graphics graphics = ...
// output generated barcode to Bitmap object
Bitmap barcodeInBitmap = barcode.drawBarcode();
// draw created barcode to HttpResponse object
HttpResponse response = ...;
// save generated barcode images to Stream object
Stream stream = ...;
How to Create Barcodes in WinForms using VB.NET Class
The following VB.NET code illustrates how to generate a barcode in VB.NET class:
' Create linear barcode object in VB.NET
Dim barcode As New BarCode()
' Set barcode symbology type to Code-39 in VB.NET
barcode.SymbologyType = SymbologyType.Code39
' Set Code39 barcode value in VB.NET
barcode.CodeText = "CODE39"
' Set Code39 drawing image format to PNG in VB.NET
barcode.Format = System.Drawing.Imaging.ImageFormat.Png
' Generate Code-39 barcode & encode to the png image in VB.NET
' other barcode outputting ways:
' to byte array
byte barcodeInBytes = barcode.drawBarcodeAsBytes()
' output generated barcode to Graphics object
Graphics graphics = ...
' output generated barcode to Bitmap object
Bitmap barcodeInBitmap = barcode.drawBarcode()
' draw created barcode to HttpResponse object
HttpResponse response = ...
' save generated barcode images to Stream object
Stream stream = ...
How to Change Barcode Size as Desired Requirements
Although default barcode size values are given while generating barcode, you can change the barcode size values from the barcode properties in the Properties window or using C# or VB.NET class codes. For example, if you want to generate a barcode type with a fixed bar width and image height,you can change the values of Width and Height under Size properties.
How to Change Barcode Properties as Specified Requirements
In addition to barcode size properties, many more barcode property options are listed in the control property board for easy operating. Each property has its own default values that are strongly recommended by KeepDynamic for generating high quality barcode image. For detailed barcode properties, please refer to the barcode type symbology properties