Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Tooltip Visibility

How can I ensure that a button's Tooltip is only visible when the button is disabled?

What can I bind the tooltip's visibility to?

like image 407
David Ward Avatar asked Jun 30 '10 11:06

David Ward


People also ask

How to use ToolTip in WPF?

You can customize tooltip content by setting visual properties and applying styles. If you define the tooltip content as a ToolTip object, you can set the visual properties of the ToolTip object. Otherwise, you must set equivalent attached properties on the ToolTipService class.

How do I disable WPF ToolTip?

You will need to set ToolTipService. ShowOnDisabled to True on the Button in order to have the Tooltip visible at all when the Button is disabled. You can bind ToolTipService. IsEnabled on the Button to enable and disable the Tooltip.

How to create a ToolTip in WPF?

Basic WPF ToolTip ExampleDrag a Button control from the toolbox and drop it. Add a ToolTip property to the button with a message you want to show on mouse hover of the button.


1 Answers

You will need to set ToolTipService.ShowOnDisabled to True on the Button in order to have the Tooltip visible at all when the Button is disabled. You can bind ToolTipService.IsEnabled on the Button to enable and disable the Tooltip.

like image 53
Quartermeister Avatar answered Oct 06 '22 16:10

Quartermeister