Export (0) Print
Expand All

ToolTipService.ToolTip Attached Property

Gets or sets the content of a tooltip.

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 GetToolTip, SetToolTip
<object ToolTipService.ToolTip="Object" .../>

Property Value

Type: System.Object
A DependencyObject element that defines the content for a tooltip. The default value is null.

Identifier field

ToolTipProperty

Metadata properties set to true

None

Tooltip content can range from a simple text string to more complex objects such as a StackPanel element that has embedded controls and images. However, tooltip content cannot take focus. For example, a Button inside a tooltip cannot receive a Click event.

Windows Presentation Foundation (WPF) provides a ToolTip control that defines a tooltip and provides properties that you can use to specify tooltip behavior. However, a tooltip can be any element, such as a DockPanel or an Image.

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

The XAML syntax shown here is appropriate if the object that fills the tooltip is a primitive with native type conversion, such as a string. If the object does not support native type conversion or support its own type converter, you might need to specify a verbose form of attached property syntax as follows:

<object>
  <ToolTipService.ToolTip>
    <objectThatFillsTheToolTip .../>
  </ToolTipService.ToolTip>
</object>

The placeholder element objectThatFillsTheToolTip could also have child elements, if that object permits them. However, the need for this usage should be relatively rare, because most XAML usages will instead use practical control implementations of the service that are exposed by ToolTip.

The following example shows how to specify a tooltip by using the ToolTipService.

<Ellipse Fill="Blue" 
       ToolTipService.ToolTip="{DynamicResource EllipseToolTip}"
       Height="25" Width="40"/>

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft