Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ToolTipService.ToolTipClosingEvent Field

Identifies the ToolTipClosingEvent event that is exposed by objects that use the ToolTipService service to display tooltips.

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

public static readonly RoutedEvent ToolTipClosingEvent
public static final RoutedEvent ToolTipClosingEvent
public static final var ToolTipClosingEvent : RoutedEvent
You cannot use fields in XAML.

Field Value

The identifier for the ToolTipClosingEvent event.

The ToolTipClosingEvent event occurs immediately before a tooltip closes.

This field registers the behavior of the ToolTipClosingEvent event for classes that use this service. The FrameworkElement and FrameworkContentElement classes both implement the ToolTipService and expose this event through the common language runtime (CLR) accessors FrameworkElement.ToolTipClosing and FrameworkContentElement.ToolTipClosing.

If you specify the tooltip as a ToolTip object, the Closed event is also raised when the tooltip closes.

The following example shows how to set an event handler for the ToolTipClosingEvent event. For the complete sample, see ToolTipService Sample.

    <Ellipse Height="25" Width="50" 
         Fill="Gray" 
         HorizontalAlignment="Left"
         ToolTipService.InitialShowDelay="1000"
         ToolTipService.ShowDuration="7000"
         ToolTipService.BetweenShowDelay="2000"
         ToolTipService.Placement="Right" 
         ToolTipService.PlacementRectangle="50,0,0,0"
         ToolTipService.HorizontalOffset="10" 
         ToolTipService.VerticalOffset="20"
         ToolTipService.HasDropShadow="false"
         ToolTipService.ShowOnDisabled="true" 
         ToolTipService.IsEnabled="true"
         ToolTipOpening="whenToolTipOpens"
         ToolTipClosing="whenToolTipCloses"
         >
  <Ellipse.ToolTip>
    <BulletDecorator>
      <BulletDecorator.Bullet>
        <Ellipse Height="10" Width="20" Fill="Blue"/>
      </BulletDecorator.Bullet>
      <TextBlock>Uses the ToolTipService class</TextBlock>
    </BulletDecorator>
  </Ellipse.ToolTip>
</Ellipse>


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;
    }       
}

ellipse2.AddHandler(ToolTipService.ToolTipOpeningEvent,
    new RoutedEventHandler(whenToolTipOpens));
ellipse2.AddHandler(ToolTipService.ToolTipClosingEvent,
    new RoutedEventHandler(whenToolTipCloses));

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2014 Microsoft