7

Tooltip is not visible on disabled checkbox even after setting ToolTipService.ShowOnDisabled="True".

<CheckBox Grid.Column="0" HorizontalAlignment="Center" Visibility="{Binding Converter={StaticResource TaskCompletionVisbilityConverter},ConverterParameter='chkbox'}" 
                             Height="16" Width="16" Foreground="{Binding Converter={StaticResource TaskColorConverter}}"
                               ToolTipService.ShowOnDisabled="True" ToolTipService.IsEnabled="True"
                              ToolTip="Check To complete Task"
                               IsEnabled="{Binding State, Converter={StaticResource EnableDisableConverter},
                        ConverterParameter='checkbox',Mode=TwoWay}" Margin="37,5,0,0">
Cœur
  • 37,241
  • 25
  • 195
  • 267
Pa1
  • 81
  • 1
  • 4
  • possible duplicate of [WPF Tooltip Visibility](http://stackoverflow.com/questions/3149016/wpf-tooltip-visibility) – netaholic Aug 27 '15 at 08:45
  • I do not think this question is a duplicate of [WPF Tooltip Visibility](http://stackoverflow.com/questions/3149016/wpf-tooltip-visibility). Indeed @Pa1 already uses `ToolTipService.ShowOnDisabled="True"` and `ToolTipService.IsEnabled="True"`. I guess the tooltip should be visible, so maybe there is something else which hides it. Pa1, can you provide more details about your XAML? – Il Vic Aug 27 '15 at 08:55

2 Answers2

11

Your code works for me. ToolTipService.ShowOnDisabled="True" should be what you need.

Please check that you haven't set IsHitTestVisible to false in any Style/ControlTemplate associated with the checkbox.

Setting IsHitTestVisible to false means that it will ignore any mouse events associated with the control and so you won't get the tooltip.

spaceplane
  • 607
  • 1
  • 12
  • 27
  • I removed all the IsHitTestVisible reference from my style but still didnt get – Pa1 Aug 27 '15 at 10:11
  • So the tooltip does display when the checkbox is enabled, but when it is disabled it won't display? Try listening to the `MouseOver` event to check that this is still being fired when the checkbox is disabled? – spaceplane Aug 27 '15 at 10:26
3

ToolTipService.ShowOnDisabled="True" was not working for me. Below works :

<DataGridCheckBoxColumn.CellStyle>
    <Style>                                     
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
    </Style>                                 
</DataGridCheckBoxColumn.CellStyle>
Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116
Palash Roy
  • 1,547
  • 1
  • 15
  • 11