Zhenia
Zhenia

Reputation: 4179

wpf ToolTip and Style

How I can add ToolTip to this code ?

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

</Style> 

Upvotes: 0

Views: 318

Answers (2)

Christian
Christian

Reputation: 143

For a more complex ToolTip use

<Style TargetType="{x:Type ListBoxItem}">  
    <Setter Property="ToolTip">
        <Setter.Value>
            <!--Content Here-->
            <!--<Grid> or <StackPanel> or <ContentPresenter>...-->
        </Setter.Value>
    </Setter>
</Style>

Upvotes: 0

Suresh
Suresh

Reputation: 4149

You can set ToolTip property in a style the same way you set any other property.

Sample code as below

<Style TargetType="{x:Type ListBoxItem}">  
    <Setter Property="ToolTip" Value="ToolTip Value" />
</Style>

Upvotes: 2

Related Questions