Generate a QR Code in C# with WinForm
What do you need?
Make sure you have Visual Studio 2019 before you start, we will immediately generate our QR Code. For this tutorial I ask you to follow the steps as they are written bellow.
First step
For this first step we will create a Windows Forms application as in the following image.
Second step
Give a name to your application and have it created.
Third step
For this step you will need a “PictureBox” to display our QR Code once generated, a “Label” to say that this QR code even this optional, a “TextBox” which will serve us to enter data which will be converted into QR Code and finally a “Button” and each time you press the button this will generate the QR code.
Fourth step
Once all the component added you could now we can install ZenBarCode which is the barcode rendering framework which simply encapsulates the native rendering of barcode symbologies without requiring third-party fonts.
For this we will go to the NuGet package management. Right click on your project> Manage the NuGet package
Step five
Look for ZenBarCode, in the list that appears install the Zen.BarCode.Rendering.Framework package
Sixth step
Once the framework installs enter your Form1.cs file and add the code that follows.
Seventh step
Now we will launch the application to test this, namely we can enter data such as a text or a website for example, and the purpose of the QR code after scanning it will redirect us for example on a website .
And the result works fine if you followed the steps, then you can scan the QR code on your cellphone to take the test.
Thank you for reading this article.