ToolTip 与 Popup(WPF 控件) [英] ToolTip versus Popup (WPF control)
问题描述
这些 WPF 控件之间的主要区别是什么?
什么时候我应该使用 ToolTip
而不是 Popup
?
What are the main differences between these WPF controls?
And when I should use a ToolTip
instead of Popup
?
推荐答案
ToolTip
是一个小弹出窗口,当用户将鼠标指针悬停在元素上时会出现;Popup
控件提供了一种在单独窗口中显示内容的方法,该窗口相对于指定元素或屏幕坐标浮动在当前应用程序窗口上.
A ToolTip
is a small pop-up window that appears when a user pauses the mouse pointer over an element; the Popup
control provides a way to display content in a separate window that floats over the current application window relative to a designated element or screen coordinate.
当鼠标指针移到其父对象上时,Popup
不会自动打开.如果您希望 Popup
自动打开,请使用 ToolTip
或 ToolTipService
类.
A Popup
does not automatically open when the mouse pointer moves over its parent object. If you want a Popup
to automatically open, use the ToolTip
or ToolTipService
class.
For more information see: ToolTip overview and Popup overview.
这篇关于ToolTip 与 Popup(WPF 控件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!