FrameworkContentElement.ToolTip 属性


获取或设置在用户界面 (UI)user interface (UI) 中为此元素显示的工具提示对象。Gets or sets the tool-tip object that is displayed for this element in the 用户界面 (UI)user interface (UI).

 property System::Object ^ ToolTip { System::Object ^ get(); void set(System::Object ^ value); };
public object ToolTip { get; set; }
member this.ToolTip : obj with get, set
Public Property ToolTip As Object



工具提示对象。The tooltip object.



下面的示例将属性的值 ToolTip 直接设置为字符串。The following example sets the value of the ToolTip property directly to a string.

// Alias the working TableRowGroup for ease in referencing.
TableRowGroup trg = tbl.RowGroups[0];
trg.Rows[0].Background = Brushes.CornflowerBlue;
trg.Rows[1].FontSize = 24;
trg.Rows[2].ToolTip = "This row's tooltip";
' Alias the working TableRowGroup for ease in referencing.
Dim trg As TableRowGroup = tbl.RowGroups(0)
trg.Rows(0).Background = Brushes.CornflowerBlue
trg.Rows(1).FontSize = 24
trg.Rows(2).ToolTip = "This row's tooltip"


如果此属性的值为类型,则这 ToolTip 是将在中使用的工具提示 UIUIIf the value of this property is of type ToolTip, then that is the tool-tip that will be used in the UIUI. 如果值为任何其他类型,则该值将用作content ToolTip 系统) 构造的 (所提供的内容。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. 有关更多信息,请参见ToolTipServiceFor more information see ToolTipService. 服务类提供附加属性,这些属性可用于进一步自定义工具提示。The service class provides attached properties that can be used to further customize a tool-tip.

XAML 属性用法XAML Attribute Usage

<object ToolTip="toolTipContent"/>  

XAML 属性元素用法XAML Property Element Usage

    <ToolTip .../>  




一个字符串,该字符串将成为的显示文本 ToolTipA string that becomes the display text for the ToolTip.

某些对象(以对象元素形式提供)应用作的内容 FrameworkContentElementSome object, provided in object element form, that should be used as the content for the FrameworkContentElement. 通常,这是一个 FrameworkElement 或一些其他元素,它将创建的布局合成 ToolTip ,最终包含组合内的文本内容。Typically this would be a FrameworkElement or some other element that creates layout compositing for the ToolTip, eventually containing text content within the compositing. 在此用法中, ToolTip 元素是从分析的隐式创建的 XAMLXAML ,而 toolTipObjectContent 内容则设置为其 ContentControl.Content 属性。In this usage, the ToolTip element is created implicitly from the parsed XAMLXAML, and the toolTipObjectContent content is set as its ContentControl.Content property.

<ToolTip .../><ToolTip .../>
请参阅 ToolTipSee ToolTip.

依赖项属性信息Dependency Property Information

标识符字段Identifier field ToolTipProperty
元数据属性设置为 trueMetadata properties set to true None