ByteScout Barcode Suite - VB.NET - Display barcode on form with barcode sdk - ByteScout

ByteScout Barcode Suite – VB.NET – Display barcode on form with barcode sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – VB.NET – Display barcode on form with barcode sdk

How to display barcode on form with barcode sdk in VB.NET and ByteScout Barcode Suite

Learn to display barcode on form with barcode sdk in VB.NET

Source code documentation samples give simple and easy method to install a needed feature into your application. ByteScout Barcode Suite: the set that includes three different SDK products to generate barcodes, read barcodes and read and write spreadsheets: Barcode SDK, Barcode Reader SDK and Spreadsheet SDK. It can display barcode on form with barcode sdk in VB.NET.

This prolific sample source code in VB.NET for ByteScout Barcode Suite contains various functions and other necessary options you should do calling the API to display barcode on form with barcode sdk. 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! Applying VB.NET application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

ByteScout Barcode Suite free trial version is available on our website. VB.NET and other programming languages are supported.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

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

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

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

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

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

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next