TMaskEdit = class(Vcl.Mask.TMaskEdit)
protected
procedure ValidateError; override;
end;
TForm1 = class(TForm)
.
.
procedure FormCreate(Sender: TObject);
.
.
.
.
.
{ TMaskEdit }
// All TMaskEdits in your form will use this procedure.
procedure TMaskEdit.ValidateError;
begin
try
inherited; // Original ValidateError
except
// Validation error occurred!
Self.Clear;
// I preferred clear the text.
// If you want you can prefer show any message.
end;
end;
Hiç yorum yok:
Yorum Gönder