WPF Show ToolTip没有动画和透明度

时间:2013-01-08 10:26:48

标签: wpf tooltip transparency

我想要显示ToolTip而没有任何透明度(也许是为了完成它 - 没有动画),并分别隐藏它。

我该怎么办?

1 个答案:

答案 0 :(得分:2)

您可以覆盖资源:

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >
    <Page.Resources>
        <PopupAnimation x:Key="{x:Static SystemParameters.ToolTipPopupAnimationKey}">None</PopupAnimation>
    </Page.Resources>

    <Button ToolTip="My ToolTip Content" Content="My Button Content" />
</Page>

来自:http://social.msdn.microsoft.com/Forums/eu/wpf/thread/a279901c-175a-4a59-a602-5ecdc66d9015