Silverlight中消除ToolTip的白色背景

Silverlight中消除ToolTip的白色背景,其实就是把ControlTemplate中的Border去掉了
<Style TargetType="ToolTip" x:Key="tooltipStyle">
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Padding" Value="3,0,3,0"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ToolTip">
                            
                                    <ContentPresenter
                              Content="{TemplateBinding Content}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              Cursor="{TemplateBinding Cursor}"
                              Margin="{TemplateBinding Padding}"/>
                               
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

posted @ 2011-10-19 16:28  Rambo'Ma  阅读(536)  评论(0编辑  收藏  举报