Tooltip in Silverlight

Introduction: Tooltip is comment or tips, which is applied on UI control. When user hovers the cursor on that control, the tooltip is appeared with given comment or tips.

We take a Silverlight application and a button control and write the following XAML code in editor

<Grid x:Name="LayoutRoot" Background="White">
    <
Button Content="I M Button" Height="22" ToolTipService.ToolTip="Click at me" HorizontalAlignment="Left" Margin="106,132,0,0" Name="button1"     VerticalAlignment="Top" Width="99" />
</
Grid>

We run our application. Here we see that when we hover the mouse pointer on button, a tooltip is appeared as Click at me as like below


tooltip


We can give a attractive look to tooltip also. Now we write following XAML code in editor

<Grid x:Name="LayoutRoot" Background="White">
            <Button Content="I M Button" Width="80" Height="50">
                <ToolTipService.ToolTip>
                    <TextBlock Height="23" Text="Click at me" Foreground="Red" FontSize="14" />
                </
ToolTipService.ToolTip>
            </Button>
</
Grid>

 Now, we run our application. The output will look as like below

 tooltip