Search code examples
wpfmousetooltip

WPF ToolTip disappears on mouse down


I've got tooltip on an element that I want to stay open even when the user clicks or holds the mouse button down while over my element.

Is there anyway to do this?


Solution

  • There is a StaysOpen tooltip property, but according to this book you are better off using a Popup control (just make it look like a tool tip).

    Here is a quote from the book:

    Has no effect in practice. The intended purpose of this property is to allow you to create a tooltip that remains open until the user clicks somewhere else. However, the ToolTipService.ShowDuration property overrides the StaysOpen property. As a result, tooltips always disappear after a configurable amount of time (usually about 5 seconds) or when the user moves the mouse away. If you want to create a tooltip-like window that stays open indefinitely, the easiest approach is to use the Popup control.