ToolTip versus Popup (WPF control)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 23:10:20

问题


What are the main differences between these WPF controls?
And when I should use a ToolTip instead of Popup?


回答1:


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.

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.




回答2:


Previous tooltips in Winforms were overly restrictive in what you could display. This is why people rolled their own. WPF tooltips allow you to apply a templatize view with color, images, formatting, you name it. The days of rolling your own in that are mostly gone; mostly.



来源:https://stackoverflow.com/questions/11073470/tooltip-versus-popup-wpf-control

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!