ByteScout BarCode Generator SDK - VB.NET - Display Barcode On Form - ByteScout

ByteScout BarCode Generator SDK – VB.NET – Display Barcode On Form

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – VB.NET – Display Barcode On Form

How to display barcode on form in VB.NET with ByteScout Barcode SDK

Write code in VB.NET to display barcode on form with this step-by-step tutorial

These sample source codes on this page below are demonstrating how to display barcode on form in VB.NET. ByteScout Barcode SDK is the robost SDK that generates high quality barcode images and pdf. Can generate all popular types of barcodes from QR Code, Code 39, Code 128, UPC, GS1, GS-128, PDF417, Datamatrix to more exotic barcode types. Fully customizable fonts, colors, print sizes. Includes special functions to ensure output quality, and tools for adding barcodes to new or existing pdf files and images. It can be used to display barcode on form using VB.NET.

This rich sample source code in VB.NET for ByteScout Barcode SDK includes the number of functions and options you should do calling the API to display barcode on form. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample codes in VB.NET.

Our website provides trial version of ByteScout Barcode SDK for free. It also includes documentation and source code samples.

Try ByteScout Barcode SDK today: Get 60 Day Free Trial or sign up for Web API

Form1.Designer.vb
      
Partial Class Form1 ''' <summary> ''' Required designer variable. ''' </summary> Private components As System.ComponentModel.IContainer = Nothing ''' <summary> ''' Clean up any resources being used. ''' </summary> ''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> Protected Overrides Sub Dispose(disposing As Boolean) If disposing AndAlso (components IsNot Nothing) Then components.Dispose() End If MyBase.Dispose(disposing) End Sub #Region "Windows Form Designer generated code" ''' <summary> ''' Required method for Designer support - do not modify ''' the contents of this method with the code editor. ''' </summary> Private Sub InitializeComponent() Me.pictureBox1 = New System.Windows.Forms.PictureBox() Me.panel1 = New System.Windows.Forms.Panel() Me.label1 = New System.Windows.Forms.Label() Me.label2 = New System.Windows.Forms.Label() DirectCast(Me.pictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' ' pictureBox1 ' Me.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.pictureBox1.Location = New System.Drawing.Point(12, 36) Me.pictureBox1.Name = "pictureBox1" Me.pictureBox1.Size = New System.Drawing.Size(270, 270) Me.pictureBox1.TabIndex = 0 Me.pictureBox1.TabStop = False ' ' panel1 ' Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.panel1.Location = New System.Drawing.Point(314, 36) Me.panel1.Name = "panel1" Me.panel1.Size = New System.Drawing.Size(270, 270) Me.panel1.TabIndex = 1 AddHandler Me.panel1.Paint, New System.Windows.Forms.PaintEventHandler(AddressOf Me.panel1_Paint) ' ' label1 ' Me.label1.AutoSize = True Me.label1.Location = New System.Drawing.Point(12, 9) Me.label1.Name = "label1" Me.label1.Size = New System.Drawing.Size(179, 13) Me.label1.TabIndex = 2 Me.label1.Text = "Show barcode in PictureBox control:" ' ' label2 ' Me.label2.AutoSize = True Me.label2.Location = New System.Drawing.Point(311, 9) Me.label2.Name = "label2" Me.label2.Size = New System.Drawing.Size(157, 13) Me.label2.TabIndex = 3 Me.label2.Text = "Draw barcode on Panel control:" ' ' Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6F, 13F) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(599, 349) Me.Controls.Add(Me.label2) Me.Controls.Add(Me.label1) Me.Controls.Add(Me.panel1) Me.Controls.Add(Me.pictureBox1) Me.Name = "Form1" Me.Text = "Form1" DirectCast(Me.pictureBox1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub #End Region Private pictureBox1 As System.Windows.Forms.PictureBox Private panel1 As System.Windows.Forms.Panel Private label1 As System.Windows.Forms.Label Private label2 As System.Windows.Forms.Label End Class

Try ByteScout Barcode SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

Form1.vb
      
Imports System.Drawing Imports System.Windows.Forms Imports Bytescout.BarCode ' This application demonstrates two ways how you can show the barcode on a form: ' 1. using PictureBox control; ' 2. painting it on a Panel control. Public Partial Class Form1 Inherits Form Private _barcode As Barcode = Nothing Public Sub New() InitializeComponent() ' Create Barcode Generator instance _barcode = New Barcode() _barcode.RegistrationName = "demo" _barcode.RegistrationKey = "demo" ' Setup barcode _barcode.Symbology = SymbologyType.QRCode _barcode.Value = "Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing" ' Put the barcode image to PictureBox pictureBox1.Image = _barcode.GetImage() End Sub ' Paint the barcode image on a Panel control Private Sub panel1_Paint(sender As Object, e As PaintEventArgs) Dim barcodeImage As Image = _barcode.GetImage() e.Graphics.DrawImage(barcodeImage, 0, 0) End Sub End Class

Try ByteScout Barcode SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

Program.vb
      
Imports System.Collections.Generic Imports System.Windows.Forms NotInheritable Class Program Private Sub New() End Sub ''' <summary> ''' The main entry point for the application. ''' </summary> <STAThread> _ Friend Shared Sub Main() Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(False) Application.Run(New Form1()) End Sub End Class

Try ByteScout Barcode SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout Barcode SDK page

Explore ByteScout Barcode SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next