If you use the Delphi/C++ Builder 2009 or later, you can use the Data property to specify a block of binary (bytes) data, and encode it into a barcode symbol, or specifies the barcode text in AnsiString format. The event occurs if there is any invalid character in the Data property value.
type
{ Defined in the pBarcode2D unit }
TOnInvalidDataChar = procedure (Sender: TObject; Index: Integer; DataChar: AnsiChar; LinearFlag: Boolean) 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 barcode text that is specified by 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.
LinearFlag: Bolean; It denotes whether the invalid character is in the the linear component of an EAN.UCC composite barcode symbol.
For the TBarcode2D_CCA, TBarcode2D_CCB, and TBarcode2D_CCC 2D barcode components, If the value of the parameter is true, the invalid character is in the Data property's value of the linear component that is specified by the Linear property, and both of the Index and DataChar parameters are depend on the Data property's value of the linear component. Otherwise, the invalid char is in the Data property's value of the 2D barcode component, and both of the Index and DataChar parameters are depend on the Data property's value of the 2D component.
For other barcode components, the value of the parameter is always false.
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.