views:

72

answers:

1

Hi,

Is it possible to declare a style that sets the fontsize of tooltips to the same size as the parent form? I have tried this...

    <Style TargetType="{x:Type ToolTip}">
        <Setter Property="FontSize" Value="{Binding ElementName=MainWindow, Path=FontSize}"/>
    </Style>

...but that doesnt work. Any suggestions?

A: 

I found a solution to my problem.

    <Style TargetType="{x:Type ToolTip}">
        <Setter Property="FontSize" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=FontSize}"/>
    </Style>
Erik Z