QR Code Image Sample - pqScan.com
C#, VB.NET Code39 Creator Encoding Code 39 Barcode Image in C# and VB.NET Online Demo Download Trial Purchase Now

How to Generate Code39 in C# and VB.NET

back to home  >  .NET Barcode Generator SDK  >   Generate Barcodes in C# & VB.NET  >  Generate Code 39 in C# & VB.NET

C# and VB.NET Code39 Creator is one of the generation functions in pqScan Barcode Creator for .NET. To keep things simple, developers can use .NET Barcode Control in WinForms project and use ASP.NET Barcode Control in web application to generate Code39 images. And creating Code39 barcode in C# or Visual Basic.NET language isalso supplied.

Learn about some other popular barcodes creation:

Encode and createCode39 - C Sharp sample

The C# code tutorial below demonstrates you how to generateCode39 barcode using C# in Console application. All available properties are listed here, so make a specific Code39 image is not hard for you now.

using System;
using System.Drawing;
using System.Drawing.Imaging;
usingPQScan.BarcodeCreator;

namespaceCode39GeneratorInCSharp
{
    classProgram
    {
        staticvoid Main(string[] args)
        {
            //Create an instance of PQScan.BarcodeCreator.Barcodeobject.
            Barcode code39 = new Barcode();
            //Set barcode date to encode
            code39.Data = "123456789";
            //Set barcode type
            code39.BarType = BarCodeType.Code39;
            //Set barcode image width
            code39.Width = 300;
            //Set barcode image height
            code39.Height = 100;
            //Set 1d barcode human-readable text to display
            code39.ShowText = true;           
            //Set barcode image foregroud color
            code39.BarcodeColor = Color.Black;
            //Set barcode image back ground color
            code39.BackgroundColor = Color.White;
            //Set barcode image format
            code39.PictureFormat = ImageFormat.Bmp;
            //Save barcode image to file
            code39.CreateBarcode("code39-csharp.bmp");

        }
    }
}

Create and generateCode39 - Visual Basic sample

This example is written in VB.NET language, introducing developers how to make a Code39 in Console application. Follow the code, you will get the perfect barcode images.

Imports System.Drawing
Imports System.Drawing.Imaging
Imports PQScan.BarcodeCreator

Namespace Code39GeneratorInVB
    Class Program
        Private Shared Sub Main(args As String())

            'Create an instance of PQScan.BarcodeCreator.Barcode object.
            Dim code39 As New Barcode()
            'Set barcode date to encode
            code39.Data = "123456789"
            'Set barcode type
            code39.BarType = BarCodeType.Code39
            'Set barcode image width
            code39.Width = 300
            'Set barcode image height
            code39.Height = 100
            'Set 1d barcode human-readable text to display
            code39.ShowText = True
            'Set barcode image foregroud color
            code39.BarcodeColor = Color.Black
            'Set barcode image back ground color
            code39.BackgroundColor = Color.White
            'Set barcode image format
            code39.PictureFormat = ImageFormat.Bmp
            'Save barcode image to file
            code39.CreateBarcode("code39-vb.bmp")

        End Sub
    End Class
End Namespace

generate code39 in c#/vb.net

.NET Barcode Creator QR Code Creator in C#/VB Data Matrix Creator in C#/VB PDF 417 Creator in C#/VB Aztec Code Creator in C#/VB EAN 13 Creator in C#/VB EAN 8 Creator in C#/VB UPC A Creator in C#/VB Code 128 Creator in C#/VB