Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.

Tooltip in wpf

Viewed:  2520 
Posted On:  12/06/2013 11:19:16 
How we can show Tooltip in WPF? How we can customized Tooltip in WPF? 

In this article I am going to show how we can customized tool tip in WPF.

<Window x:Class="ToolTip_In_WPF.Window1"
    Title="ToolTip In WPF" Height="300" Width="300">
        <Button Width="100" Height="30">Click Me
                <ToolTip>Click Me To Show Result.


Image 1.

We can host a ToolTip in any controls like in below example I am going to host tooltip in stack panel.

<Button Width="130" Height="30">Click Me
                <StackPanel Background="RoyalBlue" Height="200" Width="250">
                    <StackPanel Background="DarkOrange" Height="30" Width="240" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" >
                        <Image VerticalAlignment="Top"  Width="100" Height="35" Source="donetsg.png" Name="image1" />
                        <TextBlock FontFamily="Aharoni" FontSize="24" FontWeight="Bold" Foreground="Black" TextWrapping="Wrap"
                                   VerticalAlignment="Top" Height="30" HorizontalAlignment="Right" Width="193">
                            <Run FontFamily="Andalus" FontSize="18" FontWeight="Normal" Text="Welcome To"/>
                    <StackPanel Width="200" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" >
                        <TextBlock TextWrapping="Wrap" Foreground="#FFF9F4F4" TextAlignment="Center" Background="{x:Null}" HorizontalAlignment="Right"
erticalAlignment="Top" Width="181" Height="98">
                          <Run FontFamily="Verdana" FontSize="11" FontWeight="Normal" Foreground="#FF151514"
                               Text="WELCOME to can share your views and knowledge. "/>


Image 2.

We can also set the time duration of tooltip..

<Button ToolTip="Hi All" Width="100" Height="100"
        Content="Click Me">

         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us