 
         
         
             Important Update
                        Important Update
                    
                The sample shows instructions and algorithm of how to display barcode on form with barcode sdk and how to make it run in your VB.NET application. Want to display barcode on form with barcode sdk in your VB.NET app? ByteScout Premium Suite is designed for it. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.
Want to quickly learn? This fast application programming interfaces of ByteScout Premium Suite for VB.NET plus the guidelines and the code below will help you quickly learn how to display barcode on form with barcode sdk. IF you want to implement the functionality, just copy and paste this code for VB.NET below into your code editor with your app, compile and run your application. Use of ByteScout Premium Suite in VB.NET is also described in the documentation included along with the product.
Trial version of ByteScout Premium Suite is available for free. Source code samples are included to help you with your VB.NET app.
  On-demand (REST Web API) version: 
   Web API (on-demand version)
  
  On-premise offline SDK for Windows: 
   60 Day Free Trial (on-premise)
      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
    
    60 Day Free Trial or Visit ByteScout Premium Suite Home Page
    
    Explore ByteScout Premium Suite Documentation
    
    Explore Samples
    
    Sign Up for ByteScout Premium Suite Online Training
    Get Your API Key
    
    Explore Web API Docs
    
    Explore Web API Samples    
      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
    
    60 Day Free Trial or Visit ByteScout Premium Suite Home Page
    
    Explore ByteScout Premium Suite Documentation
    
    Explore Samples
    
    Sign Up for ByteScout Premium Suite Online Training
    Get Your API Key
    
    Explore Web API Docs
    
    Explore Web API Samples    
      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
    
    60 Day Free Trial or Visit ByteScout Premium Suite Home Page
    
    Explore ByteScout Premium Suite Documentation
    
    Explore Samples
    
    Sign Up for ByteScout Premium Suite Online Training
    Get Your API Key
    
    Explore Web API Docs
    
    Explore Web API Samples    
60 Day Free Trial or Visit ByteScout Premium Suite Home Page
Explore ByteScout Premium Suite Documentation
Explore Samples
Sign Up for ByteScout Premium Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: 
