Display Tooltip for Silverlight controls

Silverlight offers a class called "ToolTipService" which can be used to display tooltips for Silverlight controls. This class can be attached to most of the UI elements in Silverlight to display tooltips.

Simple Tooltip text

The below sample code shows how to display a simple text tooltip for a Button control:

See this example which sets a tooltip for a textbox control:

<Button Width="60" Height="20" Content="My Button">
        <ToolTip Content="This is tool tip for Button"></ToolTip>

<TextBlock Width="60" Height="20" Text="My Text">
        <ToolTip Content="This is tool tip for TextBlock"></ToolTip>

Display rich UI elements in tooltip

Silverlights ability to support UI elements in tooltip can be used to provide great user experience. We can use almost any UI element within a Tooltip. See various examples below.

Display image within a tooltip

This sample code shows how to display an image within a tooltip in Silverlight: