If you use the Delphi/C++ Builder 2009 or later, you can use the Data property to specify a barcode text in AnsiString format, and encode it into the barcode symbol. Or use the Data property to encode a block of binary (bytes) data into the barcode symbol (only for the TBarcode1D_Code128 and the TBarcode1D_EAN128 components). The event occurs if there is any invalid character in the Data property.
type
{ Defined in the pBarcode1D unit }
TOnInvalidDataChar = procedure (Sender: TObject; Index: Integer; DataChar: AnsiChar) of object;
property OnInvalidDataChar: TOnInvalidDataChar;
Sender: TObject; It is the object whose event handler is called.
Index: Integer; The index position of first invalid character in the Data property, the index 1 denotes that the first character is invalid character.
DataChar: AnsiChar; The first invalid character in the barcode text that is specified by the Data property.
If the Locked property is set to false, the event occurs when any component property is changed to cause the barcode is redrew, or when the Draw, Clear, Size, DrawTo (Syntax 1), DrawToSize (Syntax 1), Print (Syntax 1), or PrintSize (Syntax 1) method is called. Even if the Image property isn't specified.
If the Locked property is set to true, the event occurs when the Locked property is set to false to cause the barcode is redrew, or the Draw, Clear, Size, DrawTo (Syntax 1), DrawToSize (Syntax 1), Print (Syntax 1), or PrintSize (Syntax 1) method is called. Even if the Image property isn't specified.
The event is available only for the Delphi/C++ Builder 2009 or later.