procedure Tf_Otdel.FormKeyPress(Sender: TObject; var Key: Char); begin if key = #27 then begin Close; end; end;