-
Notifications
You must be signed in to change notification settings - Fork 80
/
Form1.cs
48 lines (40 loc) · 1.3 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// QR code generator library (.NET)
// https://github.com/manuelbl/QrCodeGenerator
//
// Copyright (c) 2021 Manuel Bleichenbacher
// Licensed under MIT License
// https://opensource.org/licenses/MIT
//
using System;
using System.Windows.Forms;
namespace Net.Codecrete.QrCodeGenerator.Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
errorCorrectionCombo.SelectedIndex = 1;
qrCodeControl.TextData = qrCodeText.Text;
qrCodeControl.ErrorCorrection = errorCorrectionCombo.SelectedIndex;
qrCodeControl.BorderWidth = (int)borderNumericUpDown.Value;
}
private void QrCodeText_TextChanged(object sender, EventArgs e)
{
qrCodeControl.TextData = qrCodeText.Text;
}
private void ErrorCorrectionCombo_SelectedIndexChanged(object sender, EventArgs e)
{
qrCodeControl.ErrorCorrection = errorCorrectionCombo.SelectedIndex;
}
private void BorderNumericUpDown_ValueChanged(object sender, EventArgs e)
{
qrCodeControl.BorderWidth = (int)borderNumericUpDown.Value;
}
private void CopyButton_Click(object sender, EventArgs e)
{
qrCodeControl.CopyToClipboard();
}
}
}