ARTICLE

Adding ToolTips to Windows Controls

Posted by Dinesh Beniwal Articles | Windows Forms C# July 23, 2010
In this article you will learn how to add ToolTips to Windows Controls.
Reader Level:

This article has been excerpted from book "The Complete Visual C# Programmer's Guide from the Authors of C# Corner".

In this article I will explain you about the Adding ToolTips to Windows Controls.

Adding ToolTips to Windows Controls

Adding a ToolTip to a control is a simple matter of implementing the functionality provided by the ToolTip class. There are two steps to add a ToolTip to a control: first, create an instance of the ToolTip control; second, attach a control to the ToolTip object by calling the ToolTip.SetToolTip method. To activate the ToolTip, set the Active property to true. The following code adds a ToolTip to a button control:


        ToolTip toolTip1 = new System.Windows.Forms.ToolTip();
        toolTip1.SetToolTip (button1, "This is tooltip test");
        toolTip1.Active = true;


Conclusion

Hope this article would have helped you in understanding Adding ToolTips to Windows Controls. See other articles on the website on .NET and C#.

csharp-book.gif



Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.