Windows Forms: Generate Barcode & QR Code in C#

How to Generate Barcode, QR Code in C# using Zen Barcode. This is simply a dump of to a nuget package

Step 1Click 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

generate barcode qrcode in c#Step 2: Right click on your project select Manage NuGet Packages -> Search zen barcode -> Install

install zen barcodeStep 3: Design your form as below

generate qrcode barcode in c#

Step 4: Add code to handle your form

public partial class Form1 : Form
    public Form1()

    //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);