Board index » delphi » Masked Edit for dates

Masked Edit for dates

I am using a Masked edit to get  the user to put in the correct date.
If however, they accidentally miss any numbers out then when the user
attempts to click on another component on the form then an error box pops up
saying 'Invalid Input value. Use escape key to abandon changes'.
I would like to be able to handle this my self but i can't find the event to
where the error comes from. I've tried the OnExit but this is not it.
Has this happened to anyone else and if so, what did you do about it ?
 

Re:Masked Edit for dates


From the Help file:

"ValidateEdit calls ValidateError when the EditText fails to comply with the
EditMask."

So I'd check out both ValidateEdit and ValidateError.

_______________________
Gary
http://www.delphiforfun.org
_________________________

Quote
"John" <john.shobbr...@btinternet.com> wrote in message

news:8uh0oj$s2t4@bornews.inprise.com...
Quote
> I am using a Masked edit to get  the user to put in the correct date.
> If however, they accidentally miss any numbers out then when the user
> attempts to click on another component on the form then an error box pops
up
> saying 'Invalid Input value. Use escape key to abandon changes'.
> I would like to be able to handle this my self but i can't find the event
to
> where the error comes from. I've tried the OnExit but this is not it.
> Has this happened to anyone else and if so, what did you do about it ?

Re:Masked Edit for dates


Thanks.

Re:Masked Edit for dates


You can also change the method that manage the errors in the application.

For instance

procedure form1.FechaEnter(Sender: TObject);
begin
  Application.OnException := SalidaError;
end;

procedure form1.SalidaError(Sender: TObject; E: Exception);
begin
  your own message...;
end;

Please Look For  "On Exception" and then TApplication
(in the help file of Delphi)

Quote
John <john.shobbr...@btinternet.com> wrote in message

news:8uh0oj$s2t4@bornews.inprise.com...
Quote
> I am using a Masked edit to get  the user to put in the correct date.
> If however, they accidentally miss any numbers out then when the user
> attempts to click on another component on the form then an error box pops
up
> saying 'Invalid Input value. Use escape key to abandon changes'.
> I would like to be able to handle this my self but i can't find the event
to
> where the error comes from. I've tried the OnExit but this is not it.
> Has this happened to anyone else and if so, what did you do about it ?

Re:Masked Edit for dates


That would be a lot better than that box with the bib red X.
Thanks

Other Threads