BizCode Barcode Generator for Winforms
The most robust & powerful barcode component for Microsoft .NET Windows Forms
Quick Overviews
  • Professional barcode control
  • Flexible controls provided
  • Support WinForms projects
  • Linear & 2D barcodes support
  • Winforms Data-binding support
How to Set Code 128 Size in .NET WinForms
Code 128 Generator for Winforms is easy to generate and create Code 128 barcode in Windows Forms projects. It is easy to be integrated with C#, VB.NET. .NET 2.0 and advanced version are supported, which allows this generator to be entirely developed in C# and VB.NET.
Code 128 Generator for Winforms is compatible with the latest barcode standard of Code 128. It provides various barcode sizing options to adjust every aspect of Code 128 barcode size, including bar width & height, image width & height, margin size of top, bottom, right and left, etc. This document explains how to set Code 128 barcode size in Winforms and other tutorials of Code 39 data encoding and image setting:
Code 128 Size Related Properties

Encoded Characters

With Barcode Generator for Winforms, users are allowed to encode different length characters using Code property. Longer encoded data may lead a larger size of generated Code 128 barcode.

Barcode Unit

With Barcode Generator for Winforms, users are allowed to measure the unit of Code 128 bars with pixel, cm and inch using BarcodeUnit property.

Quiet Margin

With Barcode Generator for Winforms, users are allowed to easily control the size of each margin surrounding generated Code 128 barcode using QuietMargin related properties, including TopMargin, BottomMargin, RightMargin and LeftMargin.

Bar Width & Height

With Barcode Generator for Winforms, users are allowed to quickly adjust the width and height of each bar in generated barcode using BarWidth and BarHeight property.

Barcode Width & Height

With Barcode Generator for Winforms, users are allowed to choose Code 128 barcode size using BarcodeWidth and BarcodeHeight in accordance with users’ needs. However, Barcode width and height should more than, or at least equal to the required minimum width and height.
Customize Code 128 Barcode Size in Winforms
Ensure have installed those programs before you set Code 128 size in .NET Winforms:
Customize Code 128 Barcode Size in Windows Forms Using BarcodeControl
  1. Add .NET Winforms Barcode Control onto your .NET Visual Studio Toolbox;
  2. Drag and drop the WinLinearBarcode control into the Forms;
  3. You will see a barcode image generated;
  4. Right click you mouse to activate barcode setting panel and choose Symbology to CODE128;
  5. Select Code, BarcodeUnit, BarWidth, BarHeight, BarcodeWidth, BarcodeHeight, TopMargin, BottomMargin, RightMargin, LeftMargin respectively to customize your Code 128 barcodes.
Customize Code 128 Barcode Sizes in Winforms Using C#, VB.NET Class
using BusinessRefinery.Barcode;

Linear barcode = new Linear();
barcode.Symbology = Symbology.CODE128;
barcode.Code = "0123456789";

// Change Code 128 barcode unit measuirement in Pixel, Inch and Cm
barcode.BarcodeUnit = BarcodeUnit.PIXEL;

// Specify Code 128 barcode width & height
barcode.BarcodeHeight = 100;
barcode.BarcodeWidth = 500;

// Specify Code 128 bar width & height
barcode.BarHeight = 75;
barcode.BarWidth = 3;

// Control Code 128 barcode top margin, bottom margin, right
margin and left margin size

barcode.BottomMargin = 7;
barcode.TopMargin = 7;
barcode.LeftMargin = 5;
barcode.RightMargin = 5;

barcode.drawBarcode2SizeFile("c:/code-128-csharp.gif");
Dim barcode As BusinessRefinery.Barcode.Linear = 
New BusinessRefinery.Barcode.Linear()

barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE128
barcode.Code = "0123456789"

' Change Code 128 barcode unit measuirement in Pixel, Inch and Cm
barcode.BarcodeUnit = BarcodeUnit.PIXEL

' Specify Code 128 bar width & height
barcode.BarcodeHeight = 100
barcode.BarcodeWidth = 500

' Specify Code 128 barcode width & height
barcode.BarHeight = 75
barcode.BarWidth = 3

' Control Code 128 barcode top margin, bottom margin, right
margin and left margin size

barcode.BottomMargin = 7
barcode.TopMargin = 7
barcode.LeftMargin = 5
barcode.RightMargin = 5

barcode.drawBarcode2SizeFile("c:/code-128-vb-net.gif")