ControlAdapter.OnUnload(EventArgs) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overrides the OnUnload(EventArgs) method for the associated control.
protected public:
virtual void OnUnload(EventArgs ^ e);
protected internal virtual void OnUnload (EventArgs e);
abstract member OnUnload : EventArgs -> unit
override this.OnUnload : EventArgs -> unit
Protected Friend Overridable Sub OnUnload (e As EventArgs)
Parameters
Remarks
If there is an adapter attached to a Control object and the OnUnload method is overridden, the override method is called instead of the Control.OnUnload method.
Override the OnUnload method to do target-specific processing in the Unload
stage of the control lifecycle. Typically, these are cleanup functions that precede disposition of the control.
Notes to Inheritors
When you inherit from the ControlAdapter class and the adapter overrides the OnUnload(EventArgs) method, the adapter must call the corresponding base class method, which in turn calls the OnUnload(EventArgs) method. If OnUnload(EventArgs) is not called, the Unload event will not be raised.