ABarcode ActiveX
products download buy support
FAQ resellers links
Developers

Overview
Installation
How it works
Developers
Properties
Methods
Symbologies
Users


Barcode ActiveX control for developers

When you deploy an application that works with ABarcode ActiveX Control, you may include a copy of our free download and launch the ActiveX setup program from your own installer, including command-line parameters to make the ActiveX installation unattended, invisible, and even to not to add any icon, for example:
ABarcode_ActiveXSetup.exe /SP- /VERYSILENT /SUPRESSMSGBOXES /NOCANCEL /NOICONS

If you own a Developer License, you can add the activation key to the abarcodex.ini file in the ActiveX programs folder like this:
[License]
Language=English (US)
Key=<name>, <key>
Where <name> and <key> is your license information.

Below are some examples of how to use the ABarcode ActiveX control in Windows Forms applications developed with Visual Studio 2005, using a dataset to bind the data to SQL Server.
Contact us for any other question about other versions.

Preliminary steps common to all examples

The first step is to add the ABarcodeX control to the Toolbox:
  • Open a form in Design view.
  • Right click the Toolbox inside the section where you want to show the control (i.e. General) and select Choose Items...
  • Select the COM Components tab, select ABarcodeX.Barcode (check the checkbox) and press OK.
We are going to use the same dataset as data source for all the examples:
  • Add a new data connection to the Northwind database from the Server Explorer.
    addconnection
  • Choose Add New Item from the Project menu, then select the Dataset template and press Add.
    adddataset
  • Drag and drop the Products table from the Server Explorer to the new dataset.
    addtable
  • Add a new column to the Products datatable and name it Barcode, then change its data type to System.Byte() (VB) or System.Byte[ ] (C#). This column is not required for the Form example but for Crystal Reports and RDLC report examples.
    NOTE: System.Byte() is not listed as data type in VS 2005 so you must type it manually.
    addcolumn
  • Now you can save and close the Dataset.
For the Crystal Reports and RDLC reports examples, a small function is required to convert the barcode images to byte arrays:
  • Select Add Module (VB) or Add Class (C#) in the Project menu, press the Add button, and insert the code below:

    Visual Basic .NET

        Friend Function ImageToByte(ByVal img As Image) As Byte()
            Dim imgStream As New System.IO.MemoryStream()
            img.Save(imgStream, System.Drawing.Imaging.ImageFormat.Png)
            Return imgStream.ToArray
        End Function
                  

    Visual C# .NET

        class Class1
        {
            public byte[] imageToByte(System.Drawing.Image img)
            {
                System.IO.MemoryStream imgStream = new System.IO.MemoryStream();
                img.Save(imgStream, System.Drawing.Imaging.ImageFormat.Png);
                return imgStream.ToArray();
            }
        }
                  
  • Save and close the module/class.
Choose one of the available examples to continue:
||| | || | Copyright © 1999-2017, ABarcode Software. All rights reserved. ||| | || |