procedure TForm1.Edit1Change(Sender: TObject); begin edit1.MaxLength:=11; end; procedure TForm1.Button1Click(Sender: TObject); var x:integer; begin if edit1.Text='' then begin showmessage('Kayıt Giriniz'); exit; end else if length(edit1.text) <> 11 then begin showmessage('Hatalı T.C. no'); edit1.Text:=''; edit2.Text:=''; exit; end else begin showmessage(edit1.Text); ....... end; end;