The first method is direct restriction, Edit 1. MaxLength:= 4; The second way is to realize it by yourself. Just use your example ProcedureForm 1. Edit 1Change (sender: object);
begin
If the length (Edit 1. text)>; So 4
ShowMessage ("out of range");
End;