Property: Barcode

Specifies the barcode text.

Syntax:

property Barcode: string;

Description:

Specifies the barcode text to encode it into the barcode symbol. If the property AutoCheckDigit is set to true, the check digit doesn't need to be entered in the here, otherwise the check digit can be specified by you in here. The OnChange event will occur when the property value is changed. The OnInvalidChar event will occur if there is any invalid character in the Barcode property value, and the OnInvalidLength event will occur if the length of the Barcode property value is invalid.

The property is of type string. For Delphi/C++ Builder 2007 or early, it is of type AnsiString. For Delphi/C++ Builder 2009 or later, it is in fact an UnicodeString instead of AnsiString.

For the TBarcode1D_Code128 and the TBarcode1D_EAN128 components, if you use them in the Delphi/C++ Builder 2007 or early, the property is an AnsiSting in ANSI encoding. If you want to use other encoding format (for example the UTF-8, UTF-16), please convert it in the OnEncode event, or specify the converted string in the property. Also, you can use the property to encode a block of binary (bytes) data; If you use them in the Delphi/C++ Builder 2009 or later, it is in fact an UnicodeString instead of AnsiString. By default, the unicode string will be converted to an ANSI encoding string, then be encoded into the barcode symbol. If you want to use other encoding format (for example the UTF-8, UTF-16), please convert it in the OnEncode event, or specify the converted string in the Data property. If you want to encode block of binary (bytes) data, please use the Data property, it is of type AnsiString. Note, the "\" character is used as a escape prefix, so if you want to encode the "\" character, please use the "\\" instead of it.

For the TBarcode1D_Code32 component, First "A" character does not need to be entered in the property. Also, for the TBarcode1D_PZN component, First "PZN" characters do not need to be entered in the property.

Contents