ARTICLE

Tooltip control in a windows forms application using Visual Studio 2010

Posted by Rohatash Kumar Articles | Visual Basic 2010 October 20, 2010
In this article, we will learn how to create and use a Tooltip control in a Windows Forms application using Visual Studio 2010.
 
Reader Level:

In this article, we will learn how to create and use a Tooltip control in a Windows Forms application using Visual Studio 2010.

Tooltip Control

Tooltip Control is used to display explanatory text when the mouse rest on a control or window. This control is helpful in providing a quick help to users or display information when the user moves the pointer over an associated control.

Creating a tooltip

Tooltip class is used to create a tooltip control. tooltip class object need to call a method SetToolTip.

c# code:

private void Form1_Load(object sender, EventArgs e)

        {

           ToolTip tool = new ToolTip();

           tool.SetToolTip(button1, "press the button");

        }

VB code:

Dim tool As New ToolTip()

tool.SetToolTip(button1, "Press the button.")

Now execute the application press ctrl+F5 and move the pointer over the associated control.

tool.gif

Figure 1.

Tooltip Properties

Active - Determine if the tooltip is active.

IsBalloon  - Indicates weather the tooltip will take on a balloon form.

ShowAlways - Determines if the tooltip will be displayed always, even if the parent window is not active.

ToolTipIcon -Determines the icon that is shown on the tooltip.

ToolTipTitle -Determines the Title of tooltip window.

Now taking a tooltip control on the form and set the above property of tooltip control.

tool1.gif 

Figure 2.

Now right click on the button and select property tooltip on tooltip1 of button control.

tool2.gif

Figure 3.

set the property Isballoon on true in the tooltip property window to display the tooltip as a balloon.

Now execute the application and move the pointer over the associated control.

tool4.gif

Figure 4.

Login to add your contents and source code to this article
share this article :
post comment
 
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Become a Sponsor