#863 – Tooltips Are Normally Not Shown when a Control Is Disabled

By default, a tooltip will not be shown if you hover over a control that is disabled.  This makes sense–if you can’t interact with a control, you probably don’t need to see whatever additional information the tooltip is providing.  (Although you might make the argument that a tooltip could provide information about why a particular control is disabled).

In the code below, the first button has its IsEnabled property set to false, which means that its tooltip won’t be shown when you hover over it at runtime.

    <StackPanel Margin="15">
        <Button Content="Hemingway" IsEnabled="False"
                Margin="5" Padding="10,5"
                HorizontalAlignment="Center"
                ToolTip="Ernest Hemingway (1899-1961)"/>
        <Button Content="Fitzgerald"
                Margin="5" Padding="10,5"
                HorizontalAlignment="Center"
                ToolTip="F. Scott Fitzgerald (1896-1940)"/>
    </StackPanel>

863-001

If you do want the tooltip to be displayed when the parent control is disabled, you can set the ToolTipService.ShowOnDisabled property to true.

 

Advertisements

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

2 Responses to #863 – Tooltips Are Normally Not Shown when a Control Is Disabled

  1. Pingback: WPF: How to show Tooltips of disabled control | Around computing

  2. Pingback: Dew Drop – July 15, 2013 (#1,585) | Alvin Ashcraft's Morning Dew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: