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

Definición

Genera el 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

Elemento primario original del elemento.The original parent of the item.

newParent
ToolStrip ToolStrip ToolStrip ToolStrip

Nuevo elemento primario del elemento.The new parent of the item.

Comentarios

Cuando se genera un evento, se invoca el controlador de eventos a través de un delegado.Raising an event invokes the event handler through a delegate. Para obtener más información, consulte controlar y provocar eventos.For more information, see Handling and Raising Events.

El método OnParentChanged también permite que las clases derivadas controlen el evento sin adjuntar ningún delegado.The OnParentChanged method also allows derived classes to handle the event without attaching a delegate. Ésta es la técnica preferida para controlar el evento en una clase derivada.This is the preferred technique for handling the event in a derived class.

Notas a los desarrolladores de herederos

Al reemplazar OnParentChanged(ToolStrip, ToolStrip) en una clase derivada, asegúrese de llamar al método OnParentChanged(ToolStrip, ToolStrip) de la clase base para que los delegados registrados reciban el 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.

Se aplica a