.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Articles >> Windows Application >> Post New Resource Bookmark and Share   

 Subscribe to Articles

How to use ToolTip in WindowsApplication?

Posted By:Syed Shakeer Hussain       Posted Date: August 22, 2010    Points: 25    Category: Windows Application    URL: http://www.dotnetspark.com  

With the ToolTip class, you can provide hints to a user when the user places the pointer on a control. The ToolTip class is typically used to alert users to the intended use of a control.

1)ToolTip.IsBalloon Property:-To show Balloon using ToolTip,set the Property IsBalloon=true with the ToolTip object as follows:

ToolTipobject.IsBalloon = true;

2)ToolTip.ShowAlways Property:-sets the ShowAlways property to true to enable ToolTip text to be displayed regardless of whether the form is active as follows:

ToolTipobject.ShowAlways = true;

3)ToolTip.ToolTipTitle Property:-sets a title for the ToolTip window.The maximum length of a title is 99 characters. If this property contains a string longer then 99 characters, no title will be displayed.

ToolTipobject.ToolTipTitle="User Title";

4)ToolTip.SetToolTip Method:- SetToolTip () is used Set up the ToolTip text for the Button.

ToolTipobject.SetToolTip(button1, "Hi User,Click me.");

For Example:

private void toolTip1_Popup(object sender, PopupEventArgs e)


ToolTip buttonToolTip = new ToolTip();

buttonToolTip.ToolTipTitle = "Button Tooltip";

buttonToolTip.IsBalloon = true;

buttonToolTip.ShowAlways = true;

buttonToolTip.SetToolTip(button1, "Hi User,Click me.");


ToolTip.BackColor Property :-

BackColor Property is used Gets or sets the background color for the ToolTip.

ToolTipobject.BackColor = System.Drawing.Color.Navy;

ToolTip.ForeColor Property:-

ForeColor Property is used Gets or sets the foreground color for the ToolTip.

ToolTipobject.ForeColor = System.Drawing.Color.Red;


 Subscribe to Articles


Further Readings:

Author: andy         Company URL: http://www.dotnetspark.com
Posted Date: August 22, 2010

is this applicable in wpf?
Author: Syed Shakeer Hussain         Company URL: http://www.dotnetspark.com
Posted Date: August 22, 2010

Hi andy
No,This is Windows Forms ToolTip.
Author: andy         Company URL: http://www.dotnetspark.com
Posted Date: August 23, 2010

already found
it''s looking more usable in wpf
button = new Button();
button.Content = "Hover over me.";
tt = new ToolTip();
tt.Content = "Created with C#";
button.ToolTip = tt;

or in xaml
<TextBox HorizontalAlignment="Left">ToolTip with non-text content
<DockPanel Width="50" Height="70">
<Image Source="data\flower.jpg"/>
<TextBlock>Useful information goes here.</TextBlock>

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend