ToolStripItem.OnParentChanged(ToolStrip, ToolStrip) ToolStripItem.OnParentChanged(ToolStrip, ToolStrip) ToolStripItem.OnParentChanged(ToolStrip, ToolStrip) ToolStripItem.OnParentChanged(ToolStrip, ToolStrip) Method

Definição

Aciona o evento ParentChanged.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);
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)

Parâmetros

oldParent
ToolStrip ToolStrip ToolStrip ToolStrip

O pai original do item.The original parent of the item.

newParent
ToolStrip ToolStrip ToolStrip ToolStrip

O novo pai do item.The new parent of the item.

Comentários

A geração de um evento invoca o manipulador de eventos por meio de um delegado.Raising an event invokes the event handler through a delegate. Para obter mais informações, consulte manipulando e gerando eventos.For more information, see Handling and Raising Events.

O OnParentChanged método também permite que classes derivadas manipulem o evento sem anexar um delegado.The OnParentChanged method also allows derived classes to handle the event without attaching a delegate. Essa é a técnica preferida para manipular o evento em uma classe derivada.This is the preferred technique for handling the event in a derived class.

Notas aos Herdeiros

Ao substituir OnParentChanged(ToolStrip, ToolStrip) em uma classe derivada, certifique-se de chamar o método da OnParentChanged(ToolStrip, ToolStrip) classe base para que os delegados registrados recebam o evento.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.

Aplica-se a