Raises the System.Diagnostics.Process.Exited event.
[Visual Basic] Overridable Protected Sub OnExited() [C#] protected virtual void OnExited(); [C++] protected: virtual void OnExited(); [JScript] protected function OnExited();
OnExited is the API that raises the System.Diagnostics.Process.Exited event. Calling OnExited causes the System.Diagnostics.Process.Exited event to occur. This is the only way to raise the event using the Process component, and is primarily used when subclassing the component.
As an alternative to OnExited, you can write your own event handling method. You create your own event handling delegate and your own event handling method.
Note If you are using the Visual Studio environment, an event handling delegate (AddOnExited) and an event handling method (Process1_Exited) are created for you when you drag a Process component onto a form and double-click the icon. The code you create to run when the System.Diagnostics.Process.Exited event occurs is entered into the Process1_Exited procedure. You do not need to create the OnExited member, since it is implemented for you.
Raising an event invokes the event-handling method through a delegate. For an overview, see TBD.
Notes to Inheritors: When overriding OnExited in a derived class, be sure to call the base class's OnExited method.
Process Class | Process Members | System.Diagnostics Namespace | System.Diagnostics.Process.Exited