The Barcode provides the necessary API to customize the appearance of the control. Users can set a definite bar height and bar direction for this purpose. Let's explore customization in detail.
To control the height of the bars in the Barcode control, the C1BarCode class provides the BarHeight property. With this, you can set the height, in inches, of the barcode's bars. However, if the bar height exceeds the height of the control, this property is ignored.
To control the direction of bars in the Barcode control, the C1BarCode class provides the BarDirection property that sets the directions using the BarCodeDirection enumeration.
There are four types of values for this enumeration:
BarCode Direction values | Description |
LeftToRight | The barcode symbol is printed left to right. This is the default option. |
RightToLeft | The barcode symbol is printed right to left. |
BottomToTop | The barcode symbol is printed bottom to top. |
TopToBottom | The barcode symbol is printed top to bottom. |
Let's see how to set the direction of bars in barcode via code:
The barcode in its default barcode direction looks like this:
The output of the code snippet with bar direction as RightToLeft looks like this: