Rediger

Del via


ToolStripItem.OnParentChanged(ToolStrip, ToolStrip) Method

Definition

Raises the ParentChanged event.

protected:
 virtual void OnParentChanged(System::Windows::Forms::ToolStrip ^ oldParent, System::Windows::Forms::ToolStrip ^ newParent);
protected virtual void OnParentChanged (System.Windows.Forms.ToolStrip oldParent, System.Windows.Forms.ToolStrip newParent);
protected virtual void OnParentChanged (System.Windows.Forms.ToolStrip? oldParent, System.Windows.Forms.ToolStrip? newParent);
abstract member OnParentChanged : System.Windows.Forms.ToolStrip * System.Windows.Forms.ToolStrip -> unit
override this.OnParentChanged : System.Windows.Forms.ToolStrip * System.Windows.Forms.ToolStrip -> unit
Protected Overridable Sub OnParentChanged (oldParent As ToolStrip, newParent As ToolStrip)

Parameters

oldParent
ToolStrip

The original parent of the item.

newParent
ToolStrip

The new parent of the item.

Remarks

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnParentChanged method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnParentChanged(ToolStrip, ToolStrip) in a derived class, be sure to call the base class's OnParentChanged(ToolStrip, ToolStrip) method so that registered delegates receive the event.

Applies to