0

How I can add ToolTip to this code ?

<Style TargetType="{x:Type ListBoxItem}">  

</Style> 
4

2 回答 2

2

您可以像设置任何其他属性一样在样式中设置 ToolTip 属性。

示例代码如下

<Style TargetType="{x:Type ListBoxItem}">  
    <Setter Property="ToolTip" Value="ToolTip Value" />
</Style>
于 2012-11-09T12:21:30.920 回答
0

对于更复杂的工具提示使用

<Style TargetType="{x:Type ListBoxItem}">  
    <Setter Property="ToolTip">
        <Setter.Value>
            <!--Content Here-->
            <!--<Grid> or <StackPanel> or <ContentPresenter>...-->
        </Setter.Value>
    </Setter>
</Style>
于 2012-11-10T10:58:57.273 回答