Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ToolTipService.ShowDuration Attached Property

Gets or sets the amount of time that a tooltip remains visible.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
See GetShowDuration, SetShowDuration
<object ToolTipService.ShowDuration="int" .../>

Property Value

Type: System.Int32
An integer value that represents the display time in milliseconds. The default value is 5000 milliseconds.

Identifier field

ShowDurationProperty

Metadata properties set to true

None

ExceptionCondition
ArgumentException

The value of the InitialShowDelay property is less than zero (0).

This property defines the time that a tooltip remains visible while the user pauses the mouse pointer over the object that defines the tooltip. If the user moves the mouse pointer off of the object, the tooltip closes.

This property is an attached property. For information about how to get or set the value of this property in code, see the GetShowDuration and SetShowDuration methods.

The following example shows how to set the ShowDuration property for a tooltip.


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




ToolTipService.SetShowDuration(ellipse1, 7000);


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.