Windows Forms: Generate Barcode & QR Code in C#
By FoxLearn 5/23/2017 9:53:07 PM 8.29K
How to Generate Barcode, QR Code in C# using Zen Barcode. This is simply a dump of Barcode.Render.Release.3.1.10729.zip to a nuget package
Step 1: Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "BarcodeExample" and then click OK
Step 2: Right click on your project select Manage NuGet Packages -> Search zen barcode -> Install
Step 3: Design your form as below
Step 4: Add code to handle your form
public partial class Form1 : Form { public Form1() { InitializeComponent(); } //Generate barcode private void btnBarcode_Click(object sender, EventArgs e) { Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; pictureBox.Image = barcode.Draw(txtBarcode.Text, 50); } //Generate qrcode private void btnQRCode_Click(object sender, EventArgs e) { Zen.Barcode.CodeQrBarcodeDraw qrcode = Zen.Barcode.BarcodeDrawFactory.CodeQr; pictureBox.Image = qrcode.Draw(txtQRCode.Text, 50); } }
VIDEO TUTORIALS
Categories
Popular Posts
How to Download Chromedriver for Selenium
08/29/2024
C# Tutorial
07/20/2024
How to Download Microsoft SQL Server
06/22/2024
What is ARM architecture?
04/01/2024