gpt4 book ai didi

c# - 带工具提示的图像控制

转载 作者:太空宇宙 更新时间:2023-11-03 14:35:44 26 4
gpt4 key购买 nike

我正在用 C# 创建一个 WPF 应用程序,我有一个带有图像的图像控件。我希望它在鼠标悬停在其上时显示带有图像和文本的 ToolTip。那么当鼠标悬停在图像上时,我该如何制作带有图像的ToolTip。在此先感谢您的帮助。

最佳答案

尝试这样的事情。

<!-- This is the image that has the tooltip -->
<Image Source="...">
<Image.ToolTip>
<!-- A tooltip can contain any element. Here we put a text
block and another image. -->
<StackPanel>
<TextBlock>This is the tooltip text</TextBlock>
<!-- This image appears inside the tooltip -->
<Image Source="..." />
</StackPanel>
</Image.ToolTip>
</Image>

关于c# - 带工具提示的图像控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1166262/

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