Displaying a barcode on a form

To display a barcode on a form a PictureBox is used to hold the image.

 

Place a PictureBox Windows Forms control on the form and add some code to your program to take the barcode image from the dBarcode.NET component and use it as the Image for the PictureBox

For example:

 

private void DoBarcode()                  Visual Basic

{

      Dim g As Graphics = PictureBox1.CreateGraphics()

      Abcnet1.Caption="1234"

      PictureBox1.Image=Abcnet1.Barcode(g)

      g.Dispose()

 

}

 

private void DoBarcode()                  C#

{

      Graphics g=pictureBox1.CreateGraphics();

      abcnet391.Caption="1234";

      pictureBox1.Image=abcnet391.Barcode(g);

      g.Dispose();

}

 

private void DoBarcode()

{

      Graphics g=pictureBox1.CreateGraphics();

      abcnet391.set_Caption("1234");

      pictureBox1.set_Image(abcnet391.Barcode(g));

      g.Dispose();

}

 

More:

Printing a barcode image