KA.Barcode for .NET WinForms
How to Create & Resize QR Code in .NET WinForms
Source code to generate, print QR Code images using Barcode Generator for .NET WinForms Control
  • Completely written in managed C# with full integration for .NET Framework
  • ITF-14 ASP.NET, Word Code 39, ASP.NET UPC-E, .NET WinForms PDF417 & .NET Codabar can be created as well
  • Dynamically generate QR Code and other linear & 2D barcodes in Windows Forms and Crystal Reports
  • Programmatically create, print QR Code in C#, VB.NET class library
  • Automatic version & data mode selection for QR Code generation & integration
  • Support to print 2D barcode in ASP.NET as well, including Intelligent Mail Word, UPC-E Java, Code 128 C#
  • Creating, drawing QR Code with specified module size, image width & height, quiet zones, etc
  • Support 4 levels of QR Code Error Correction Level (QRCodeECL)to protect data from damage
  • Generate QR Code matrix bar code in stream object, in graphics object, and image formats
KA.Barcode Generator for .NET WinForms provides easy barcode generating in Windows Forms, Crystal Reports, as well as C#, VB.NET class & console applications.
Flexible sizing options are provided with detailed guide for users to easily resize generated barcode images. For other QR Code tutorial, please check here:
QR Code Size Setting with C#, VB.NET Class in .NET WinForms

Install QR Code Barcode Creator Control into .NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Windows.dll" to your .NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your Visual Studio .NET toolbox
Copy the C# or VB.NET barcode onto you programs to make a QR Code in .NET WinForms with the creator:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.QRCode;
barcode.CodeToEncode = "QRCode";
Dim barcodeAs KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.QRCode
barcode.CodeToEncode = "QRCode"

Drawing Data Matrix with Selected Unit of Measure

With KA.Barcode Generator for .NET WinForms, users have three units of measure to select for QR Code generation in .NET WinForms, including Pixel, Cm, and Inch. You can copy the C#/ VB.NET sampel code below to adjust:
barcode.BarcodeUnit = BarcodeUnit.Pixel;
barcode.BarcodeUnit = BarcodeUnit.Pixel
QR Code Size Setting in with VB.NET Class. ....
QR Code in ASP.NET Application. How to create QR Code images in ASP.NET web applications using free QR Code Barcode Generator Demo. ....
With the user-friendly interface, users can adjust various dimensions of the generated QR Code image through VB.NET programming. ....
How to create barcode in C#.NET using Client Report RDLC? ....

Creating QR Code with Specified Module Size in .NET WinForms

If you want to print a QR Code with specified module size, you can easily do so by setting both QR Code "X" and "Y" dimensions - bar width & bar height. Here is the C# & VB.NET sample code:
barcode.X = 3;
barcode.Y = 3;
barcode.X = 3
barcode.Y = 3

Generating QR Code with Specified Version

According to ISO+IEC+18004 QR Code barcode symbology specification, KA.Barcode Generator for .NET WinForms provides the complete set of 40 versions for users to choose from. Copy the demo code below to adjust:
barcode.QRCodeVersion = QRCodeVersion.V5;
barcode.QRCodeVersion = QRCodeVersion.V5

Adding Quiet Zones on Four Sides for QR Code

It is specified in ISO/IEC standard that for a QR Code symbol, the nominal reflectance value of surrounding margins should be 4X-wide for better readability. For example, if you set QR Code module size (X & Y) to 3 pixels, you should add the code below:
barcode.LeftMargin =12;
barcode.RightMargin = 12;
barcode.TopMargin = 12;
barcode.BottomMargin = 12;
barcode.LeftMargin =12
barcode.RightMargin = 12
barcode.TopMargin = 12
barcode.BottomMargin = 12
QR Code Size Setting with Drag & Drop BarcodeControl in .NET WinForms
  1. 1.
    Add .NET WinForms BarCodeControl into Visual Studio .NET Toolbox
  2. 2.
    Drag and drop the BarCodeControl into the Forms to generate a Codabar at default
  3. 3.
    Right click the barcode to select "Properties" and choose"QRCode" in the "Symbology" and input data to encode
  4. 4.
    Set "X" and "Y" to 3, and "Version" to "V5"
  5. 5.
    Input "TopMargin", "BottomMargin", "RightMarign" and "LeftMargin" value of 12 pixels
  6. 6.
    Now the customized QR Code appears on the form