Visual Studio 2010 - Barcodes in projects

EnterpriseTo use this functionality you require the Enterprise Edition

How to add a barcode to a Visual Studio 2010 project

Flash Video

You can use ActiveBarcode in Visual Studio 2010 like any other control (e.g. like a button). First you have to add the ActiveBarcode control into the development environment.

Adding ActiveBarcode to the development environment
Go to the menu "Tools" and select the function "Choose Toolbox items":

Barcode, Visual Studio 2010

A dialog appears. As ActiveBarcode is a COM component first select the tab "COM Components". A list of the available controls will be displayed. Select "ActiveBarcode" and activate it.

Barcode, Visual Studio 2010

Then click OK. Now ActiveBarcode is added to your development environment.

Use ActiveBarcode (A simple example)
Create a new project. To add the ActiveBarcode Control to a form you select the function "Toolbox" from the "View" menu first. This opens the toolbox. "Toolbox". Have a look for the ActiveBarcode Control in the toolbox now.

Barcode, Visual Studio 2010

Click on ActiveBarcode there and move it the form you want to place the control. The control will then be placed on this form.

Barcode, Visual Studio 2010

You can change the barcode properties of the barcode control now or later. In this example we change the background color to white:

Barcode, Visual Studio 2010

Now add a "Textbox" to this form, too.

Barcode, Visual Studio 2010

Double click this textbox now to open the source code for the event "Textchange". We will use this event to change the barcodes content every time the textbox changes.

Barcode, Visual Studio 2010

This code example is for Visual Basic. With Visual C# you use the following code for the assignment og the text property:

axBarcode1.Text = textBox1.Text;
That's it. Now launch this example application:

Barcode, Visual Studio 2010

If you change the content of the textbox in the running application, the barcode will encode this.

Not visual usage of ActiveBarcode:
You also can create ActiveBarcode at run time and use the the control:

In the following example ActiveBarcode is created invisible, then a Code 128 with the encoded content "Example" is generated and saved as image file by using the SaveAsBySize function.

Visual Basic:

Dim MyObject As Object
MyObject = CreateObject("BARCODE.BarcodeCtrl.1")
MyObject.text = "Example"
MyObject.typename = "Code 128"
MyObject.SaveAsBySize("example.bmp", 400, 100)
Visual C#:
BARCODELib.Barcode ab = new BARCODELib.Barcode();
ab.Text = "123456789012";
ab.TypeName = "EAN 13";
ab.SaveAsBySize("example.bmp", 400, 150);



Related video:

Video (Flash) Description Size
Icon Visual Studio:
Using the ActiveBarcode control in a Visual Studio project.
2,2MB Enterprise


Read more descriptions of how to add barcodes to standard applications (e.g. Office, Excel, Word, Access forms, Access reports, PowerPoint, Visio, OpenOffice.org, Lotus Notes, Publisher, Freelance, Freehand MX, Image Editors, WordPad, etc.)

rss twitter
| Home | Shop | Email | Datenschutz | Sitemap | Print preview | Version 5.58 | © Lars Schenk & Frank Horn

All trademarks and product names mentioned are the property of their respective owners.