ToolTip.Closed ToolTip.Closed ToolTip.Closed ToolTip.Closed Event

Definición

Se produce cuando se cierra ToolTip y ya no está visible.Occurs when a ToolTip is closed and is no longer visible.

public:
 event System::Windows::RoutedEventHandler ^ Closed;
public event System.Windows.RoutedEventHandler Closed;
member this.Closed : System.Windows.RoutedEventHandler 
Public Custom Event Closed As RoutedEventHandler 

Ejemplos

El ejemplo siguiente muestra cómo establecer un controlador de eventos para el Opened y Closed eventos.The following example shows how to set an event handler for the Opened and Closed events.

tooltip.Opened +=
  new RoutedEventHandler(whenToolTipOpens);
tooltip.Closed +=
  new RoutedEventHandler(whenToolTipCloses);
AddHandler tooltip.Opened, AddressOf whenToolTipOpens
AddHandler tooltip.Closed, AddressOf whenToolTipCloses

void whenToolTipOpens(object sender, RoutedEventArgs e)
{
    Ellipse ell = new Ellipse();
    if (sender.GetType().FullName.Equals("System.Windows.Shapes.Ellipse"))
    {
        ell = (Ellipse)sender;
        ell.Fill = Brushes.Blue;
    }
    else if (sender.GetType().FullName.Equals(
                             "System.Windows.Controls.ToolTip"))
    {
        ToolTip t = (ToolTip)sender;
        Popup p = (Popup)t.Parent;
        ell = (Ellipse)p.PlacementTarget;
        ell.Fill = Brushes.Blue;
    }
}

void whenToolTipCloses(object sender, RoutedEventArgs e)
{
    Ellipse ell = new Ellipse();
    if (sender.GetType().FullName.Equals(
                      "System.Windows.Shapes.Ellipse"))
    {
        ell = (Ellipse)sender;
        ell.Fill = Brushes.Gray;
    }
    else if (sender.GetType().FullName.Equals(
                           "System.Windows.Controls.ToolTip"))
    {
        ToolTip t = (ToolTip)sender;
        Popup p = (Popup)t.Parent;
        ell = (Ellipse)p.PlacementTarget;
        ell.Fill = Brushes.Gray;
    }
}


Private Sub whenToolTipOpens(ByVal sender As Object, ByVal e As RoutedEventArgs)
	Dim ell As New Ellipse()
	If sender.GetType().FullName.Equals("System.Windows.Shapes.Ellipse") Then
		ell = CType(sender, Ellipse)
		ell.Fill = Brushes.Blue
	ElseIf sender.GetType().FullName.Equals("System.Windows.Controls.ToolTip") Then
		Dim t As ToolTip = CType(sender, ToolTip)
		Dim p As Popup = CType(t.Parent, Popup)
		ell = CType(p.PlacementTarget, Ellipse)
		ell.Fill = Brushes.Blue
	End If
End Sub

Private Sub whenToolTipCloses(ByVal sender As Object, ByVal e As RoutedEventArgs)
	Dim ell As New Ellipse()
	If sender.GetType().FullName.Equals("System.Windows.Shapes.Ellipse") Then
		ell = CType(sender, Ellipse)
		ell.Fill = Brushes.Gray
	ElseIf sender.GetType().FullName.Equals("System.Windows.Controls.ToolTip") Then
		Dim t As ToolTip = CType(sender, ToolTip)
		Dim p As Popup = CType(t.Parent, Popup)
		ell = CType(p.PlacementTarget, Ellipse)
		ell.Fill = Brushes.Gray
	End If
End Sub

Comentarios

El FrameworkElement.ToolTipClosing también es el evento se genera cuando el ToolTip control está cerrado.The FrameworkElement.ToolTipClosing event is also raised when the ToolTip control is closed.

Información sobre eventos enrutadosRouted Event Information

Campo de identificadorIdentifier field ClosedEvent
Estrategia de enrutamientoRouting strategy PropagaciónBubbling
delegadoDelegate RoutedEventHandler

Se aplica a

Consulte también: