ToolTip.Opened Event

 

Occurs when a ToolTip becomes visible.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public Event Opened As RoutedEventHandler

The FrameworkElement.ToolTipOpening event is also raised when the ToolTip control opens.

Identifier field

OpenedEvent

Routing strategy

Bubbling

Delegate

RoutedEventHandler

The following example shows how to set an event handler for the Opened and Closed events.

AddHandler tooltip.Opened, AddressOf whenToolTipOpens
AddHandler tooltip.Closed, AddressOf whenToolTipCloses

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

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: