This has been excerpted from book "The Complete Visual C# Programmer's Guide from the Authors of C# Corner".
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#.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.


Tim ClaasonPosted Jan 8, 2010, 9:55 AM
Another way to do it would be to extend a base control: class MyButton : System.Windows.Forms.Button { public void AddToolTip(string text) { Tooltip tip = new System.Windows.Forms.ToolTip(); tip.SetToolTip(this, text); tip.Active = true; } }
Nikhil KumarPosted Jan 6, 2010, 7:56 AM
You are writting such a begginer blog ! nice