Customization in Windows Forms Barcode

18 Nov 20181 minute to read

The color of the barcode can be customized by modifying the DarkBarColor and LightBarColor properties of the barcode control.

this.sfBarcode1.DarkBarColor = System.Drawing.Color.FromArgb(255, 0, 0);
this.sfBarcode1.LightBarColor = System.Drawing.Color.FromArgb(255, 0, 0);
Me.SfBarcode1.DarkBarColor = System.Drawing.Color.FromArgb(255, 0, 0)
Me.SfBarcode1.LightBarColor = System.Drawing.Color.FromArgb(255, 0, 0)

The DarkBarColor represents the color of the dark bar (black color usually) and the LightBarColor represents the color of the gap between two adjacent black bars (white color usually).

WinForms Barcode color combinations - Red

Barcode color combinations- Red

WinForms Barcode color combinations - Blue

Barcode color combinations- Blue

NOTE

The DarkBarColor and LightBarColor customizations are applicable only for one-dimensional barcodes. In order for a barcode symbol to be recognized by a scanner, there must be adequate contrast between the dark bars and the light spaces, and not all barcode scanners have support for colored barcodes.