Barcode Library for VB.NET

Last Updated on November 10, 2022 by Humera Hallari

To create a Barcode using Visual Basic VB.NET is certainly very easy when you have a simple library. Barcodes themselves are usually used to store important and unique information in the form of the identity of goods that with one and the other are not the same.

By using barcodes will make it easier when inputting the identity of goods in a software. In addition, barcodes will significantly reduce input errors that are common when done manually.

How to Create a Barcode in VB.NET

1) Download the Barcode Library below this article. Then extract first, and in it there is a file called “MessagingToolkit.Barcode.dll“.
2) Open your Visual Studio, create a project with VB.NET Windows Form Application.
3) Right-click on the “References” menu, then you select “Add Reference“. Then point to the “MessagingToolkit.Barcode.dll” file that you have downloaded earlier.
4) Add it to the form, a button, picturebox, and textbox.
5) Double-click on the button and copy paste code below.

        Dim gbarcode As New MessagingToolkit.Barcode.BarcodeEncoder
        Try
            Dim barcodeimage As Image
            barcodeimage = New Bitmap(gbarcode.Encode(MessagingToolkit.Barcode.BarcodeFormat.Code128, "DRW8555RE"))
            e.Graphics.DrawImage(barcodeimage, CInt((e.PageBounds.Width - 150) / 2), 35 + height2, 150, 35)
        Catch ex As Exception
            MsgBox(ex.Message)
            Exit Sub
        End Try

6) Done, you can use this barcode in your project.

Barcode library is very useful, but it is recommended to use a maximum of 18 digit numbers. In addition, the size of this library is very light. You can download the Barcode library for VB.NET through the following link.

Developer: Microsoft
Website: https://www.microsoft.com

Read more about Basic Reports VB.NET & Crystal Reports Source Code [Project], Shopping Receipt + QRcode VB.NET, Receipt Report With Barcode VB.NET

1 thought on “Barcode Library for VB.NET”

  1. Hi, I am a great fun of your work but I would like to know how I can use vb.net or c# to read a barcode on a patient id card so that it can be received in the textboxes of the winform.
    For example, if I have the patient’s name and id on his card, after using the barcode on the card, the name and other information should appear on the fields(textboxes)

    Reply

Leave a Comment