FrameworkElement.ToolTip Property
Gets or sets the tool-tip object that is displayed for this element in the user interface (UI).
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
'Declaration <BindableAttribute(True)> _ <LocalizabilityAttribute(LocalizationCategory.ToolTip)> _ Public Property ToolTip As Object
<object> <object.ToolTip> <ToolTip .../> </object.ToolTip> </object> - or - <object> <object.ToolTip> toolTipObjectContent </object.ToolTip> </object>
<object ToolTip="toolTipContent"/>
XAML Values
Property Value
Type: System.ObjectThe tooltip object. See Remarks below for details on why this parameter is not strongly typed.
If the value of this property is of type ToolTip, then that value is the tool-tip that will be used in the UI. If the value is of any other type, then that value will be used as the content for a ToolTip provided (constructed) by the system. For more information, see ToolTipService. The service class provides attached properties that can be used to further customize a ToolTip.
The following example creates a ToolTip in code and then sets the ToolTip property on a StatusBar control.
Private Sub MakeProgressBar(ByVal sender As Object, ByVal e As RoutedEventArgs) sbar.Items.Clear() Dim txtb As New TextBlock() txtb.Text = "Progress of download." sbar.Items.Add(txtb) Dim progressbar As New ProgressBar() progressbar.Width = 100 progressbar.Height = 20 Dim duration As New Duration(TimeSpan.FromSeconds(5)) Dim doubleanimation As New DoubleAnimation(100.0, duration) progressbar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation) Dim ttprogbar As New ToolTip() ttprogbar.Content = "Shows the progress of a download." progressbar.ToolTip = (ttprogbar) sbar.Items.Add(progressbar) End Sub
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.