Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode > VB.NET Barcode Generation Guide > VB.NET Code 39 Barcode Generator for .NET WinForms, ASP.NET
Download Barcode for .NET Suite Trial

VB.NET Code 39 Barcode Generator Library

How to Encode & Create Code 39 Images in .NET applications in Visual Basic/VB.NET
  • Compile advanced linear Code 39 barcode features into a sigle VB.NET Barcode Library (DLL) file
  • Written entirely in managed C#, reliable barcoding assemblies for .NET Framework 2.0 or above
  • Directly use .NET Barcode Generator SDK barcoding functions for linear Code 39 barcode generation
  • Generate Code 39 barcode images for .NET applications, like ASP.NET, Windows Forms, .NET Class Library & Console Application
  • Insert & add Code 39 barcode images in SQL Server Reporting Services applications (2005 & 2008)
  • Create & add Code 39 linear images in .NET Crystal Reports and Client RDLC Reports
  • Encode & save ISO/IEC compatible Code 39 barcodes in image files as well as byte stream objects
  • Support user-defined Code 39 image generation and adjustment in VB.NET programming
  • Support royalty free redistribution with the purchase of provided .NET developer license
VB.NET Linear Code 39 Barcode Introduction
In specific applications, 1D barcode Code 39 may be called Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or USD-3.
Barcode Standard Compatibility: Code 39 barcodes created by this VB.NET Barcode Generator Library is in accordance with ISO / IEC 16388 (2nd edition 2007-05-15) barcode specification.
In 1974, Dr. David Allais and Ray Stevens of Intermec created Code 39 barcode. Now, this linear barcode type is often used in Non-retail environments, U.S. Government and military use and Health Industry Bar Code Council (HIBCC)).
Code 39 has 43 encodable characters that includes A-Z, 0-9, 7 special chars [-(Dash), $(Dollar), %(Percentage), (Space), .(Point), /(Slash), +(Plus)], and 1 start/stop characters (*).
For more Code 39 information, please see .NET Code 39 Barcode Introduction.
How to Generate Code 39 Linear Barcode Using VB.NET Class Library?

How to Install

  1. Add barcode dll component to your VB.NET project reference.
    • Click "Project" and select "Add Reference...".
    • Click "Browse" to find Barcodelib.Barcode.ASP.NET.dll or BarcodeLib.Barcode.WinForms.dll in the unzipped file, and click "OK" button.
  2. Add BarcodeLib barcoding dlls to Visual Studio Toolbox.
    • Right click in Toolbox and select "Choose Items...".
    • In the pop-up "Choose Toolbox items" window, click "Browse..." to select either BarcodeLib.Barcode.WinFroms.dll or Barcodelib.Barcode.ASP.NET.dll.
    • Click "OK" and now four items are listed in VS Toolbox, for example: LinearWinForm, DataMatrixWinForm, PDF417WinForm, and QRCodeWinForm. And now it's done!

How to Implement

Now, you can copy the free VB.NET demo code below to create a Code 39 barcode image in .NET Framework Class Library.
     Imports BarcodeLib.Barcode

Dim code39 As New BarcodeLib.Barcode.Linear()
code39.Type = BarcodeType.CODE39
code39.Data = "CODE39-99887766"

code39.N = 3
code39.AddCheckSum = True
code39.UOM = UnitOfMeasure.PIXEL

' Set Code 39 barcode image size and quiet zones.
code39.BarWidth = 1
code39.BarHeight = 80
code39.LeftMargin = 6
code39.RightMargin = 6
code39.TopMargin = 6
code39.BottomMargin = 6
code39.ImageFormat = System.Drawing.Imaging.ImageFormat.Png

' More Code 39 barcode settings here, like image color, font, human-readable text font etc

' Save Code 39 barcode image into your system

' Generate Code 39 barcode & output to byte array
byte[] barcodeInBytes = code39.drawBarcodeAsBytes()

' Generate Code 39 barcode to Graphics object
Graphics graphics = ...

' Generate Code 39 barcode and output to HttpResponse object
HttpResponse response = ...

' Generate Code 39 barcode and output to Stream object
Stream stream = ...
Above Code 39 sample code is written in Visual Basic
How to Generate Code 39 Bar Codes in VB.NET ASP.NET Web Applications?
To generate Code 39 barcodes in ASP.NET, you may follow the steps below (Two Methods Provided).
  1. VB.NET Code 39 barcode generation through BarcodeLib Buildin ASP.NET Barcode Application.
    • Unzip the downloaded evaluation package, and copy barcode folder and its contents to your IIS folder, eg. C:\inetpub.
    • Create a new virtual directory in your IIS, name it "barcode", and connect it to the above "barcode" folder in inetpub.
    • Restart IIS for a Code 39 streaming test.Simply navigate to:
      Above is the generated Code 39 barcode image. If you need to adjust other Code 39 dimensions, please view more web stream URL parameters for Code 39 here: .NET Code 39 Barcode Property Settings.
    • You can also insert this Code 39 image in your aspx or html page, simply pass the url to IMG tag or src value.
      For example:
      <img src=http://YourDomain:port/barcode/linear.aspx?Type=7&Data=CODE39-99887766&LeftMargin=6&RightMargin=6 />
      This method will not generate any barcode images in your IIS server side.
  2. VB.NET Code 39 barcodes encoding through ASP.NET Web Form Controller.
    • Intall ASP.NET barcode controller to your barcoding project by adding reference.
    • Add barcode library to your Visual Studio toolbox.
    • Open barcode in your unzipped trial package, and copy files "linear.aspx", "linear.aspx.cs" to the aspx page where you will be generating Code 39 images.
    • Now you can drag LinearASPNET to your ASP.NET web site, and change Code 39 settings through properties window on the right.
    • Run the project and a Code 39 barcode is generated on your aspx pages.
    • Or you may directly generate Code 39 barcodes using above free sample VB.NET code for your ASP.NET applications.
How to Create Linear Code 39 Images in VB.NET Windows Applications?
  1. Add reference to BarcodeLib.Barcode.WinForms.dll to your barcoding project.
  2. BarcodeLib.Barcode.WinForms.dll to your Visual Studio toolbox.
  3. You can simply drag the LinearWinForm to your windows form, and a Code 39 barcode is generated.
  4. Or you may directly create Code 39 barcodes using above free sample VB.NET code for your .NET Windows Forms applications.
VB.NET Barcode Generator Control Supporting Symbologies
VB.NET Linear Barcodes:
VB.NET Matrix Barcodes:
VB.NET Barcode Control Creates 1D (Linear) Barcodes: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, Code 128, EAN 8, EAN 13, EAN 128, Interleaved 2 of 5, ITF14 (UPC Shipping Container Symbol), MSI Plessey, OneCode, Planet, Postnet, RM4SCC (British Royal Mail 4-State Customer Barcode), UPC-A, UPC-E.
VB.NET Barcode Control Creates 2D (Matrix) Barcodes: Data Matrix, PDF417, QR Code.