The UltraBarcode™ control exposes the following events:
The ErrorMessageDisplayingEventArgs object’s ErrorMessage property allows you to get or set the error message. The DataChangedEventArgs object’s NewData property conveniently allows you to get the value of the UltraBarcode control’s Data property that has just been changed.
You will handle the DataChanged and ErrorMessageDisplaying events .
Add a UltraBarcode control to your form. For more info on this, see Adding Barcode In Code-Behind .
Handle the event:
In Visual Basic:
Import Infragistics.Controls.Barcodes
Private Sub Barcode_DataChanged (ByVal sender As System.Object,
ByVal e As DataChangedEventArgs)
Dim errorMessage = e.ErrorMessage
End Sub
Private Sub Barcode_ErrorMessageDisplaying (ByVal sender As System.Object, ByVal e As ErrorMessageDisplayingEventArgs)
Dim newData = e.NewData
End Sub
In C#:
using Infragistics.Controls.Barcodes;
private void Barcode_ErrorMessageDisplaying(object sender,
ErrorMessageDisplayingEventsArgs e) {
string errorMessage = e.ErrorMessage;
}
private void Barcode_DataChanged(object, DataChangedEventArgs e) {
string newData = e.NewData;
}
Save and run your application.
In Visual Basic:
Dim Barcode As New UltraPdf417Barcode()
Barcode.Data = "xamBarcode"
Barcode.EncodingMode = CompactionMode.Numeric
In C#:
var Barcode = new UltraPdf417Barcode();
Barcode.Data = "xamBarcode";
Barcode.EncodingMode = CompactionMode.Numeric;