Coding⏱️ 2 min read📅 2026-06-03

How to Fix: wpf: how to show tooltip when button disabled by command?

Show tooltip when button is disabled due to command.CanExecute returning false.

Quick Answer: Use ToolTipService.ShowOnDisabled with true and set the tooltip's visibility based on the button's state in the code-behind.

📋 Table of Contents

  1. 💡 Solution
  2. 🎯 Final Words

To show a tooltip when a button is disabled due to a command's CanExecute returning false, you can use the ToolTipService.ShowOnDisabled property in combination with the Button's IsEnabled property.

💡 Solution

  • Set ToolTipService.ShowOnDisabled to true in your XAML.

Step-by-Step Solution

  1. Step 1: In your XAML, add ToolTipService.ShowOnDisabled to the Button element.

Example:

<Button Command="{Binding Path=CommandExecuteAction}" ToolTip="{Binding Path=Description}" ToolTipService.ShowOnDisabled="true" IsEnabled="{(Binding CanExecute, Converter={StaticResource canExecuteConverter})}">

🎯 Final Words

By setting ToolTipService.ShowOnDisabled to true, you ensure that the tooltip is displayed regardless of the button's enabled state.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions