gpt4 book ai didi

c# - 如何在 C# WPF 中鼠标悬停时弹出图像

转载 作者:太空宇宙 更新时间:2023-11-03 23:18:46 25 4
gpt4 key购买 nike

如何制作鼠标悬停在图标上时会弹出的图片like this

我的图标的 xaml 代码

<Image x:Name="image" HorizontalAlignment="Left" Height="27" Margin="157,257,0,0" VerticalAlignment="Top" Width="26" Source="img/info.png" Cursor="Hand">
<Image.OpacityMask>
<ImageBrush ImageSource="img/info.png"/>
</Image.OpacityMask>
</Image>

最佳答案

为什么不在图标上使用工具提示

<Image x:Name="image" HorizontalAlignment="Left" Height="27" Margin="157,257,0,0" VerticalAlignment="Top" Width="26" Source="img/info.png" Cursor="Hand">
<Image.OpacityMask>
<ImageBrush ImageSource="img/info.png"/>
</Image.OpacityMask>
<Image.ToolTip>
<ToolTip Placement="Bottom">
<ToolTip.Template>
<ControlTemplate>
<StackPanel>
<Path Margin="34,0,0,0" Fill="#e5AAAAAA" Data="M 0 16 L 16 0 L 32 16 Z"/>
<Image Height="100" Width="80" Source="img/bigImage.png"/>
</StackPanel>
</ControlTemplate>
</ToolTip.Template>
</ToolTip>
</Image.ToolTip>
</Image>

关于c# - 如何在 C# WPF 中鼠标悬停时弹出图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36203201/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com