Set up the OnExit event for prod1.
Now, click on prod2, and in the Object Inspector window click on events. Click _once_ in the right hand column next to OnExit, and a drop-down will appear. Click on the drop-down arrow, and select the procedure you've already written (probably prod1Exit). Repeat this for prod3, prod4, prod5.
If you like you could rename prod1Exit to prodExit to make it a bit more intuitive. If you do this in the Object Inspector, Delphi will magically change the name everywhere it needs to be changed.
If, in prodExit, you need to tell which of the five prod's called the routine, you can use the Sender object:
will hide whichever prod called the OnExit;
will test true iff prod1 caused the call to OnExit.