Code 128 FAQ in VB.NET Barcode Generator SDK

Generate Code 128 and adjust Code 128 data, image, size, and other properties with VB source code available
Barcode in VB.NET > Linear > Code 128 FAQ
Barcode Control Library SDK for VB.NET - Code 128 Barcode FAQ in Visual Basic.NET
VB.NET Code 128 barcode control software supports Code 128 barcode including Code 128A, Code 128B and Code 128C generation and printing in Visual Basic.NET programs using VB.NET source code. The generated Code 128 is dynamically displayed in VB.NET projects as Gif, Tiff, Bmp, Png or Jpeg formats. Royalty-free developer license is available with purchase of products.
This article walkthroughs Code 128 barcode basic settings and special settings in VB.NET applications using Visual Basic.NET class method from the following aspects:
  • Barcode Generator Library DLL for VB.NET - Code 128 Data Encoding
  • Barcode Generator Library DLL for VB.NET - Code 128 Special Settings
  • Barcode Generator Library DLL for VB.NET - Code 128 Size Adjustment
  • Barcode Generator Library DLL for VB.NET - Code 128 Image Customization
  • Barcode Generator Library DLL for VB.NET - Code 128 Solution Project Support
Barcode Control Library DLL for VB.NET - Code 128 Data Encoding
Linear Code 128 Barcode Valid Data in Barcode Control SDK
  • Standard ASCII characters: 0-127 including A-Z, a-z, 0-9 and special characters
  • Extended ASCII characters: 128-255
Code 128 VB.NET Sample Code:
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.Code128
barcode.BarcodeData = "TerrekCode128-in-VB.NET"
Code 128 Human-Readable Text
VB.NET Barcode control SDK is able to enable or disable barcode data in Code 128 symbol. Developers may change this option via DisplayData. Type is bool.The default is true.
The text font of Code 128 is changeable. The font used to display text in barcode image. Type is TextStyle, default is New Font("Arial", 9.0F, FontStyle.Regular). The color & space of text font are adjustable.
Code 128 VB.NET Sample Code:
barcode.DisplayData = True
barcode.TextStyle = New Font("Arial", 9.0F, FontStyle.Regular)
barcode.TextColor = Color.Black
barcode.TextSpace = 8
Barcode Control Library SDK for VB.NET - Code 128 Special Settings
Code 128 Three Code Sets
Code 128 has three code sets that is Code set A, Code set B, and Code set C. Code set A encodes upper case letters, punctuation characters and control characters. Code set B encodes upper case letters, lower case letters and punctuation characters. Code set C encodes the set of 100 digit pairs from 00 to 99 inclusive. If programmers are not familiar with these Code 128 code set, Auto set is supplied with barcode generator and control SDK for Terrek. Users may select different Code 128 Code sets using Symbol property.
Code 128 VB.NET Sample Code:
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.Code128_A
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.Code128_B
barcode.Symbol = Terrek.Barcode.BarcodeSymbol.Code128_C
Code 128 Wide Bar to Narrow Bar Ratio
As the name specified, it means the ratio between wide bar and narrow bar, the value ranges from 2.0f to 3.0f. The default is 2.0f, developers may change the value through WideVSNarrow property.
Code 128 VB.NET Sample Code:
barcode.WideVSNarrow = 2.0f
Code 128 Tilde Function
Set the Tilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Type is bool. Default is true.
Code 128 VB.NET Sample Code:
barcode.Tilde= True
Barcode Control Library DLL for VB.NET - Code 128 Size Adjustment
Code 128 UOM (Unit of Measure)
Set property MeasuringUnit for properties BarWidth, BarHeight, MarginL and MarginT. Valid values are PIXEL, CM and INCH. Default is PIXEL. With this UOM setting, users can control the whole barcode size to a unique type.
Code 128 VB.NET Sample Code:
barcode.MeasuringUnit = Terrek.Barcode.MeasuringUnit.PIXEL
Code 128 Module Size
Code 128 bar size refers to the BarWidth and BarHeight of a module bar. When developers need to create barcodes with a fixed bar width, these two properties need to be implemented. With the ImageResize applied, image width & image height are changed according to the customization of bar width and bar height. The type is float.
Code 128 VB.NET Sample Code:
barcode.BarWidth = 1
barcode.BarHeight = 80
Code 128 Image Size
Code 128 image size refers to the whole barcode image size including image width and image height. If the module size is unknown, you can set the ImageHeight and ImageWidth directly with the applying of ImageResize to true. The generated Code 128 is 100% compatible with International Standard ISO/IEC 15417.
Code 128 VB.NET Sample Code:
barcode.ImageWidth = 100
barcode.ImageHeight = 100
Code 128 Margin Size
Increasing the width of margins around the symbol is one way to enhance the readability of the Code 128 barcode image. The barcode control library SDK set the left, right, top, and bottom margins separately with float values. The default value is 0.
Code 128 VB.NET Sample Code:
barcode.MarginL = 3
barcode.MarginR = 3
barcode.MarginT = 3
barcode.MarginB = 3
Barcode Control Library DLL for VB.NET - Code 128 Image Customization
Code 128 Image Format
Code 128 generated in Visual Basic.NET programs with barcode control software can be displayed as Gif, Tiff, Bmp, Png, Jpeg and other image formats. Programmers may change the format using BarcodeFormat property.
Code 128 VB.NET Sample Code:
barcode.BarcodeFormat = System.Drawing.Imaging.ImageFormat.Png
barcode.SaveAsImage("C:\code128.png")
Code 128 Image Resolution
DPI (Dots per inch) is used commonly as the measure of printing resolution. The resolution of image generated by Code 128 generator SDK could be managed with DPI and compatible with all printers. Type is int. Default is 96 dpi. Programmers can set resolution with DotsPerInch property.
Code 128 VB.NET Sample Code:
barcode.DotsPerInch = 96
Code 128 Image Position
The created Code 128 is flexible to change the placement in VB.NET projects with source. By customizing the BarAlign properly, the image is presented left, right or center in documents or projects. By changing Rotation property, the image can be rotated to 90, 180, and 270 degrees. The default is 0 degree.
Code 128 VB.NET Sample Code:
barcode.Rotation = Terrek.Barcode.Rotation.Degree90
barcode.BarAlign = Terrek.Barcode.BarAlign.Left
Code 128 Image Color
It is able to change barcode colors with barcode library software DLL using VB.NET class. Both background color and foreground color are easy to be changed by manipulating ImageColor and BarColor respectively.
Code 128 VB.NET Sample Code:
barcode.ImageColor = Color.White
barcode.BarColor = Color.Black
Barcode Control Library DLL for VB.NET - Code 128 Development Environments
VB.NET barcode control generator SDK is able to implement into multiple VB.NET projects using VB.NET code with source to create dynamic Code 128 barcode as image. These following applications are completely compatible with barcode control DLL using Visual Basic.NET programming. Tutorial to create & print barcode images using VB.NET.
  • Windows Forms Application (design-time and runtime support)
  • Visual Basic Console Application (runtime support)
  • Visual Basic Class Library (runtime support)
  • Windows Service (runtime support)
  • ASP.NET Applications (design-time and runtime support)
  • Web Service (runtime support)
  • Crystal Report for .NET (runtime support)
  • Reporting Service Applications (design-time and runtime support)