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類型,則這就是將在 UIUI中使用的工具提示。If the value of this property is of type ToolTip, then that is the tool-tip that will be used in the UIUI. 如果值為任何其他類型,則該值將作為系統所提供(已建立)之 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 Attribute UsageXAML Attribute Usage

<object ToolTip="toolTipContent"/>  

XAML 屬性項目用法XAML Property Element Usage

    <ToolTip .../>  




字串,會成為 ToolTip的顯示文字。A string that becomes the display text for the ToolTip.

在物件專案表單中提供的某些物件,應該用來做為 FrameworkContentElement 的內容。Some 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. 在此用法中,會以隱含的方式從剖析的 XAMLXAML建立 ToolTip 專案,並將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
設定為 true 的中繼資料屬性Metadata properties set to true NoneNone