Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET WinForms Barcode> .NET Windows Forms Barcode Generator Guide> .NET WinForms Barcode Generation Guide in VB.NET
Download Barcode for .NET WinForms Trial

How to Generate Barcode Images in .NET WinForms using VB.NET

Barcode for .NET WinForms - How to Encode .NET WinForms Project Barcodes with VB Code
  • Fully designed in C#, combining all linear & 2d barcoding features into a single .NET WinForms DLL assembly
  • Add BarcodeLib.Barcode.WinForms.dll into VS .NET WinForms project within several steps
  • Draw and save barcode images using VB.NET class code, no need for other barcoding controls
  • Directly create and print barcode images in VB.NET class, instead of loading .NET barcode control on form
  • Use VB.NET code to generate extremely accurate barcodes, compatible with latest barcode specifications
  • All encoded barcode images in VB.NET can be printed by almost all printers
Prerequisites for .NET WinForms C# Barcoding
  • BarcodeLib.Barcode.WinForms.dll
  • Microsoft .NET Framework 2.0 (or later)
  • Visual Studio .NET 2005 or above
Draw Barcode Images in .NET WinForms using VB.NET Class

Install

  1. Create a Visual Basic .NET windows applications in Microsoft Visual Studio.
  2. Right click in "Solution Explorer", and select "Add Reference...".
  3. In the pop-up window, click "Browse" to add "BarcodeLib.Barcode.WinForms.dll" to project reference.
  4. Now you can see the barcode library added to your project reference.

Implement

  1. When the barcode control dll is added to reference, you can programmatically input the Visual C# syntax for barcode printing. Here is a C# example for you, please copy to your project for a barcode printing test.
     Dim barcode As BarcodeLib.Barcode. Linear

barcode = New BarcodeLib.Barcode. Linear()
barcode.Type = BarcodeType.CODE39
barcode.Data = "CODE39"
barcode.UOM = BarcodeLib.Barcode.UnitOfMeasure.PIXEL
barcode.Rotate = BarcodeLib.Barcode.RotateOrientation.BottomFacingDown

barcode.BarWidth = 1
barcode.BarHeight = 80

barcode.LeftMargin = 5
barcode.RightMargin = 5
barcode.TopMargin = 5
barcode.BottomMargin = 5

' Save barcode image into your system
barcode.drawBarcode("c:/qrcode-vbnet.png")

' Generate barcode output to byte array
byte[] barcodeInBytes = barcode.drawBarcodeAsBytes()

' Generate barcode to Graphics object
Graphics graphics = ...
barcode.drawBarcode(Graphics)

' Generate barcode and output to HttpResponse object
HttpResponse response = ...
barcode.drawBarcode(response)

' Generate barcode and output to Stream object
Stream stream = ...
barcode.drawBarcode(stream)
Paint Barcode Images with Windows Form Controller
  1. Add Reference "BarcodeLib.Barcode.WinForms.dll" to your barcode generating project. View How
  2. Add the barcode component library to your Visual Studio toolbox.
    • If toolbox is not displayed in Visual Studio, click "View" in VS and select "Toolbox".
    • Right click in Toolbox and select "Choose Items...".
    • In the "Choose Toolbox Item" window, click "Browse" to find "BarcodeLib.Barcode.WinForms.dll" from the unzipped trial version.
    • Now the below four items have been added to the Toolbox.



    • Be aware of the .net barcode control that you should add to the windows form for dynamic barcode painting.
      Please pay attention that "LinearWinForm" component supports various 1D barcode types including Code 39, Code 128, Interleaved 2 of 5, etc. You can select barcode type in the Properties table, as well as other barcode parameters.
.NET Windows Forms Barcode Generator DLL Supported Barcodes
  • .NET Windows Forms 1D Barcodes Types
    Support 1D Barcodes:


  • .NET Windows Forms 2D Barcodes Types
    Support 2D Barcodes:

Other Related Barcode Generation Controls for .NET Framework