Kod: Tümünü seç
procedure TForm1.Edit1KeyPress(Sender: TObject;
var Key: Char);
const
AllowedChars: string = 'abcdefghijklmnopq' +
'rstuvwxyz01234567_.@';
var
i: Integer;
Ok: Boolean;
begin
i := 0;
Ok := False;
{ Eğer sonraki satırı silersen kullanıcı backspace türü tuşları kullanamıyacak }
if Key = #8 then Ok := True;
repeat
i := i + 1;
if Key = AllowedChars[i] then Ok := True;
until (Ok) or (i = Length(AllowedChars));
if not Ok then Key := #0;
end;