You can use a mask edit component, but personally I found it has to many restrictions.
What I generally do is OnChange event convert the text to a
number, and generating some messages;
procedure Form.Edit1Change(Sender: TObject);
begin
val(edit11.text,dip,code); //convert to number
if code = 0 then
begin
Do_Some_Stuff;
end
else
begin
Vol1.Caption := '-----';
warning.caption := 'invalid input';
illegal_operations;
end;
There are other ways, but if your input must be in a specified range, you have to test it before further processing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.