[C #] [VB.NET] Barcode generation

[C #] [VB.NET] Barcode generation


I. Description of the problem

How to generate BarCode

Second, the method

There are two key deal with this problem: BarCode fonts and around BarCode data to add *

1. Download and install the free BarCode font (Code39)

http://www.squaregear.net/fonts/free3of9.shtml

image

image

2. The establishment of a new project, adding TextBox1, Label1, Button1 in the Form, in Button1.Click event, add the following program

VB.NET


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Label1.Text = "*" + UCase(TextBox1.Text) + "*"
        Label1.Font = New Font("Free 3 of 9", 20, Label1.Font.Style, Label1.Font.Unit)
    End Sub

C#

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = "*" + textBox1.Text.ToUpper() + "*";
            label1.Font = new Font("Free 3 of 9", 20, label1.Font.Style, label1.Font.Unit);
        }

3. Perform results

Text (1) Input want to become Barcode in TextBox1

(2) produced by Button1 Barcode to Label1

image

Third, with reference Links

MSDN forum: barcode production problems

Original: Large column  [C #] [VB.NET] Barcode generated


Guess you like

Origin www.cnblogs.com/chinatrump/p/11458538.html