<Window x:Class="WPF控件_6_工具提示.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <StackPanel HorizontalAlignment="Left">

        <!-- 鼠标放上去会有提示 -->
        <Button Padding="3" ToolTip="呵呵">嘻嘻嘻</Button>

        <!-- 显示图片背景颜色 -->
        <Button Padding="3">
            <Button.ToolTip>
                <StackPanel>
                    <TextBlock Margin="3">图片提示</TextBlock>
                    <Image Source="public/9b3412d16970a7749cf6cf4d6ebf5b86.jpg" />
                    <TextBlock Margin="3">图片提示</TextBlock>
                </StackPanel>
            </Button.ToolTip>

            <Button.Content>显示图片背景颜色</Button.Content>
        </Button>

        <!-- 按钮提示设置背景颜色 -->
        <Button Padding="3">
            <Button.ToolTip>
                <ToolTip Background="#60AA4030" Foreground="White" HasDropShadow="False">
                    <StackPanel>
                        <TextBlock Margin="3">图片提示</TextBlock>
                        <Image Source="public/9b3412d16970a7749cf6cf4d6ebf5b86.jpg" />
                        <TextBlock Margin="3">图片提示</TextBlock>
                    </StackPanel>
                </ToolTip>
            </Button.ToolTip>

            <Button.Content>按钮提示设置背景颜色</Button.Content>
        </Button>
        
        <Button Padding="3">
            <Button.ToolTip>
                <!-- Placement 位于哪里显示  -->
                <ToolTip Background="Aqua" Foreground="White" HasDropShadow="True" Placement="Absolute">
                    <StackPanel>
                        <TextBlock Margin="3">图片提示</TextBlock>
                        <Image Source="public/9b3412d16970a7749cf6cf4d6ebf5b86.jpg" />
                        <TextBlock Margin="3">图片提示</TextBlock>
                    </StackPanel>
                </ToolTip>
            </Button.ToolTip>
            
            <Button.Content>按钮提示设置背景颜色</Button.Content>
        </Button>
    </StackPanel>
</Window>