ByteScout BarCode Generator SDK - C# - WinForms Barcode Control - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout BarCode Generator SDK – C# – WinForms Barcode Control

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – C# – WinForms Barcode Control

winforms barcode control in C# using ByteScout Barcode SDK

Write code in C# to make winforms barcode control with this How-To tutorial

Today we will explain the steps and algorithm of implementing winforms barcode control and how to make it work in your application. ByteScout Barcode SDK was made to help with winforms barcode control in C#. 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.

C# code snippet like this for ByteScout Barcode SDK works best when you need to quickly implement winforms barcode control in your C# application. This C# sample code should be copied and pasted into your application’s code editor. Then just compile and run it to see how it works. Enhanced documentation and tutorials are available along with installed ByteScout Barcode SDK if you’d like to dive deeper into the topic and the details of the API.

Our website provides free trial version of ByteScout Barcode SDK. It comes along with all these source code samples with the goal to help you with your C# application implementation.

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

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

MainForm.Designer.cs
      
namespace BarcodeControlTester { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #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 void InitializeComponent() { Bytescout.BarCode.Margins margins1 = new Bytescout.BarCode.Margins(); Bytescout.BarCode.SymbologyOptions symbologyOptions1 = new Bytescout.BarCode.SymbologyOptions(); this.barcodeControl = new Bytescout.BarCode.BarcodeControl(); this.SuspendLayout(); // // barcodeControl // this.barcodeControl.AddChecksum = true; this.barcodeControl.AddChecksumToCaption = true; this.barcodeControl.AdditionalCaption = "Codabar"; this.barcodeControl.AdditionalCaptionFont = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.barcodeControl.AdditionalCaptionPosition = Bytescout.BarCode.CaptionPosition.Above; this.barcodeControl.Angle = Bytescout.BarCode.RotationAngle.Degrees0; this.barcodeControl.BarHeight = 50; this.barcodeControl.CaptionFont = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); this.barcodeControl.CaptionPosition = Bytescout.BarCode.CaptionPosition.Below; this.barcodeControl.Dock = System.Windows.Forms.DockStyle.Fill; this.barcodeControl.DrawCaption = true; this.barcodeControl.HorizontalAlignment = Bytescout.BarCode.BarcodeHorizontalAlignment.Center; this.barcodeControl.Location = new System.Drawing.Point(0, 0); margins1.Bottom = 5; margins1.Left = 5; margins1.Right = 5; margins1.Top = 5; this.barcodeControl.Margins = margins1; this.barcodeControl.Name = "barcodeControl"; this.barcodeControl.NarrowBarWidth = 3; symbologyOptions1.CodabarChecksumAlgorithm = Bytescout.BarCode.CodabarChecksumAlgorithm.AiimCheckDigit; symbologyOptions1.CodabarStartSymbol = Bytescout.BarCode.CodabarSpecialSymbol.A; symbologyOptions1.CodabarStopSymbol = Bytescout.BarCode.CodabarSpecialSymbol.B; symbologyOptions1.Code128Alphabet = Bytescout.BarCode.Code128Alphabet.A; symbologyOptions1.DrawIntercharacterGap = true; symbologyOptions1.ShowStartStop = true; this.barcodeControl.Options = symbologyOptions1; this.barcodeControl.RenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault; this.barcodeControl.Size = new System.Drawing.Size(450, 287); this.barcodeControl.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; this.barcodeControl.Symbology = Bytescout.BarCode.SymbologyType.Codabar; this.barcodeControl.TabIndex = 0; this.barcodeControl.Value = "012345"; this.barcodeControl.VerticalAlignment = Bytescout.BarCode.BarcodeVerticalAlignment.Middle; this.barcodeControl.WideToNarrowRatio = 2; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(450, 287); this.Controls.Add(this.barcodeControl); this.Name = "MainForm"; this.Text = "Form1"; this.ResumeLayout(false); } #endregion private Bytescout.BarCode.BarcodeControl barcodeControl; } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode SDK Home Page

Explore ByteScout Barcode SDK Documentation

Explore Samples

Sign Up for ByteScout Barcode SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

MainForm.cs
      
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace BarcodeControlTester { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode SDK Home Page

Explore ByteScout Barcode SDK Documentation

Explore Samples

Sign Up for ByteScout Barcode SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Program.cs
      
using System; using System.Collections.Generic; using System.Windows.Forms; namespace BarcodeControlTester { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode SDK Home Page

Explore ByteScout Barcode SDK Documentation

Explore Samples

Sign Up for ByteScout Barcode SDK 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 SDK Home Page

Explore ByteScout Barcode SDK Documentation

Explore Samples

Sign Up for ByteScout Barcode SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next