procedure TForm1.Edit1Exit(Sender: TObject); begin if ActiveControl.Name = 'Button1' then Exit; ... ... ... end;