如何编程方式显示一个WPF / C#Windows.Control.ToolTip?

编程入门 行业动态 更新时间:2024-10-28 20:30:24
本文介绍了如何编程方式显示一个WPF / C#Windows.Control.ToolTip?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

似乎没有成为一个.Show()种方法为Windows.Control.ToolTip,包括在ToolTipService。任何想法?

There doesn't seem to be a .Show() kind of method for the Windows.Control.ToolTip, incl in ToolTipService. Any ideas?

谢谢!您的帮助。 : - )

Thanks! For your help. :-)

推荐答案

您需要做的就是确保在控制工具提示的类型为工具提示。然后你就可以将IsOpen属性设置为true,像这样:

What you need to do is make sure the ToolTip on the control is of type ToolTip. Then you can set the IsOpen property to true like so:

ToolTip tooltip = new ToolTip{ Content = "My Tooltip" }; NameTextBox.ToolTip = tooltip; tooltip.IsOpen = true;

更多推荐

如何编程方式显示一个WPF / C#Windows.Control.ToolTip?

本文发布于:2023-11-07 07:03:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565837.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方式   WPF   Windows   Control   ToolTip

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!