0
点赞
收藏
分享

微信扫一扫

WPF ToolTip

江南北 2023-05-15 阅读 103

<Window x:Class="WpfApplication1.MainWindow"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         Title="MainWindow" Height="350" Width="525">    <Window.Resources>
         <Style x:Key="Simple" TargetType="{x:Type ToolTip}">
             <Setter Property = "HorizontalOffset" Value="50"/>
             <Setter Property = "VerticalOffset" Value="50"/>
             <Setter Property = "Background" Value="LightBlue"/>
             <Setter Property = "Foreground" Value="Purple"/>
             <Setter Property = "FontSize" Value="20"/>
             <Setter Property = "FontWeight" Value="Bold"/>
         </Style>
     </Window.Resources>
     <TextBlock>
       TextBox with ToolTip
       <TextBlock.ToolTip>
       <ToolTip Style="{StaticResource Simple}">
         <Grid>
           <Grid.ColumnDefinitions>
             <ColumnDefinition></ColumnDefinition>
             <ColumnDefinition></ColumnDefinition>
           </Grid.ColumnDefinitions>
           <Image Grid.Column="0" Width="20px" Height="20px" Source="TradClock.png"></Image>
           <TextBox Grid.Column="1">useful information goes here</TextBox>
         </Grid>
       </ToolTip>
       </TextBlock.ToolTip>
     </TextBlock></Window>

举报

相关推荐

0 条评论