Link Search Menu Expand Document

Getting Started in C# (WinForms control)

The following example demonstrates how to generate barcode image using Windows Forms control BarcodeControl in Visual Basic.NET

First Step

When using this class in a Windows application, you just need to copy the Bytescout.BarCode.dll file to your application's directory and add reference to Bytescout.BarCode component in your project refrences.

The following example illustrates how you can set properties of BarcodeControl control. This example requires that BarcodeControl with barcodeControl1 name is added to a form and that the Bytescout.BarCode namespace has been added to the source code for your form. You can also fine tune control appearance by means of Windows Forms designer.

VB
private void SetMarginsAndRotate()
{
    // create new Margins object and set it's properties
    Bytescout.BarCode.Margins margins1 = new Bytescout.BarCode.Margins();
    margins1.Bottom = 0;
    margins1.Left = 50;
    margins1.Right = 50;
    margins1.Top = 0;
    this.barcodeControl1.Margins = margins1;

    // set rotation angle (270 degrees clockwise)
    this.barcodeControl1.Angle = Bytescout.BarCode.RotationAngle.Degrees270;
}

Copyright © 2016 - 2021 ByteScout