码迷,mamicode.com
首页 > Windows程序 > 详细

wpf ,tooltip的style

时间:2015-08-13 19:58:40      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

    <Style x:Key="MyToolTipStyle" TargetType="ToolTip">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
					<Border MaxWidth="600" MinHeight="16" MaxHeight="320" Padding="5,5,5,5" BorderBrush="{DynamicResource Brush_Gray_l6_FFCACACA}" Background="White" BorderThickness="1">
                    <TextBlock TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Text="{TemplateBinding ContentControl.Content}"/>
					</Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

  使用如下

 

 <TextBlock Text="{Binding Content}" Grid.Row="0" Height="35" Grid.ColumnSpan="1" TextTrimming="CharacterEllipsis" Margin="0,50,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                            <TextBlock.ToolTip>
                                <ToolTip Style="{StaticResource MyToolTipStyle}" Content="{Binding Content}" />
                            </TextBlock.ToolTip>
                        </TextBlock>

  

wpf ,tooltip的style

标签:

原文地址:http://www.cnblogs.com/m7777/p/4728169.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!