#859 – Changing the Amount of Time That a ToolTip Is Shown For

By default, a ToolTip will be displayed for 5 seconds before automatically disappearing.  To change this value, set the ToolTipService.ShowDuration property on the element to which the tooltip is attached.

In the example below, we change our tooltip to only stay displayed for 2 seconds (2000 milliseconds).

        <Button Content="Read a Book"
                Padding="10,5" HorizontalAlignment="Center"
                ToolTipService.ShowDuration="2000">
            <Button.ToolTip>
                <ToolTip >
                    <StackPanel>
                        <TextBlock Text="Reading Suggestion" FontWeight="Bold"/>
                        <TextBlock Text="Charles Dickens" Margin="5"/>
                    </StackPanel>
                </ToolTip>
            </Button.ToolTip>
        </Button>

859-001

Advertisement

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

One Response to #859 – Changing the Amount of Time That a ToolTip Is Shown For

  1. Pingback: Dew Drop – July 9, 2013 (#1,581) | 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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: