How to add a barcode to a Visual Studio project
You can use the ActiveBarcode control in Visual Studio like you do with any other control, e.g. a button.
First you have to add the ActiveBarcode control into the development
environment.
1. Adding ActiveBarcode to the development environment
Go to the menu "Tools" and select the function "Choose Toolbox items":
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.
Then click OK.
Now ActiveBarcode is added to your development environment.
2. Use ActiveBarcode in your project
Create a new project. Be aware that you select a project type that supports ActiveX controls:
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 or search for the ActiveBarcode Control in the toolbox now.
Click on ActiveBarcode there and move it the form you want to place the control. The control will then be placed on this form.
You can change the barcode properties of the barcode control now or later. In this example we change the background color to white:
Now add a "Textbox" to this form, too.
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.
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:
If you change the content of the textbox in the running application, the barcode will encode this.