Siverlight去掉ToolTip的白色边框

control作为tooltip后,外框背景是白色的,并且有边框。  我们可以定义 一个样式去掉。

<Style x:Key="ToolTipTransparentStyle" TargetType="ToolTip">
        <Setter Property="Background" Value="#FFF7F8FA"/>
        <Setter Property="Padding" Value="0,0,0,0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                        <Border BorderThickness="1" CornerRadius="1" Padding="{TemplateBinding Padding}">
                            <Border.Resources>
                                <Storyboard x:Key="Visible State"/>
                                <Storyboard x:Key="Normal State"/>
                            </Border.Resources>
                            <ContentPresenter Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"/>
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

在创建 ToolTip实例的时候,把ToolTip.Style 用上这个样式就可以了。

参考:http://www.cnblogs.com/eagle1986/archive/2012/05/12/2497189.html

时间: 2024-08-11 04:02:22

Siverlight去掉ToolTip的白色边框的相关文章

echarts 怎样去掉白色边框线 和怎样去除背景中的网格

echarts怎样去掉白色边框线: echarts怎样去除背景中的网格线

Spinner(三)——去掉系统Spinner的边框颜色

/** * Demo描述: * 去掉系统Spinner的边框颜色 * * * 1 在drawable中定义gradient_spinner.xml如下 * <?xml version="1.0" encoding="utf-8"?> * <selector xmlns:android="http://schemas.android.com/apk/res/android"> * <item><layer-

Android实现圆形Imageview,带白色边框

最近做了个UI效果,要求头像是圆形的,外面有白色边框 有需要的同学可以看看,效果如下 附上实现代码 RoundImageView: public class RoundImageView extends ImageView { public RoundImageView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public RoundImageView(Context context) { s

input 去掉点击后出现的边框

添加属性 :focus{outline:none} 就可以去掉默认点击时,边框会出现的蓝色边框. :focus 选择器用于选取获得焦点的元素.提示:接收键盘事件或其他用户输入的元素都允许 :focus 选择器. 不想点击时每次都要设置的话,最好在默认样式中就设置: 1 input,textarea,a:focus { 2 outline: none; 3 } 用 :focus  实现外部边框改变颜色: 1 input:focus { 2 outline:1px solid #7c448f; 3

如何去掉Installshield 安装界面边框上的Installshield wizward

因为是第一次使用Installshield,所以并不熟悉,在制作安装包的过程中出现了很多问题,这些问题可能并不是什么大问题,但我也是在网上找了很长时间才找到的. Installshield 默认的安装会在安装界面的边框上有Installshield Wizward的字样,这里提示边框上的Installshield Wizward 和安装界面上的还不一样,需要分开处理. 这里先介绍如何去掉边框上的Installshield Wizward 字样,并替换为自己想要的字符. 其实就是添加一句话,在fu

Highcharts 柱图 每个柱子外围的白色边框

Highcharts 柱图中每条柱外会有默认白色的边框, 去边框代码如下: plotOptions: { bar: { borderColor: "",//去边框 } }

HTML页面表单输入框去掉鼠标选中后边框变色的效果

标题说的有些含糊,实在不知道怎么描述了,就简单说一下吧,一个最简单的表单,代码如下,没有任何样式和名字, 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>文本框鼠标点中时边框不变色</title> 6 </head> 7 <body> 8 <input type="text"

小程序如何去掉button组件的边框

小程序获取用户授权不再支持wx.getUserInfo方法,改为用button获取,格式如下 <button class="btn btn" open-type="getUserInfo" @getuserinfo="getUserInfo">授权</button> 小程序授权更改说明文档 问题是我不想用button,我想用个图片是否可以呢?一开始我直接用<image src='xxx' open-type=&quo

CSS实现鼠标放图片上显示白色边框+文字描述

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-