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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With