Click here to Skip to main content
6,596,602 members and growing! (20,824 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » General     Beginner

How To Add ToolTips To Controls On A Windows Form

By Naveen K Kohli

Tips on how to add tooltips to controls on windows form in the .NET framework
C#, VC7, Windows, .NET 1.0, Dev
Posted:7 Jan 2001
Updated:1 Feb 2001
Views:123,007
Bookmarked:31 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
30 votes for this article.
Popularity: 4.64 Rating: 3.14 out of 5
7 votes, 33.3%
1
1 vote, 4.8%
2

3
8 votes, 38.1%
4
5 votes, 23.8%
5
  • Download demo project - 22 Kb
  • This article is a tip on how to add tooltips to controls on a windows form. Just follow the following steps and the form designer will take care of all the code addition into the source file.

    1. From the ToolBox drop a ToolTip control on the form for which you want to add the tooltips.
    2. Then click on the control that you want to add the tooltip.
    3. In the properties page of that control you will see a ToolTip property. Just add the text that you want to show up as a ToolTip for the control.

    When you add a ToolTip control to a form, it is active by default. Therefore, you do not have to do anything to make it active. If you look at the source file for your form, you will see code that looks something like as follows.

    private System.WinForms.ToolTip m_wndToolTip;
    
    this.m_wndToolTip = new System.WinForms.ToolTip (this.components);
    
    m_wndToolTip.SetToolTip (PictureButton, "Click Me!");
    m_wndToolTip.SetToolTip (m_wndIntTextBox, "Enter Integer data type value.");

    The SetToolTip method associates ToolTip text with the given control. If you wish to deactivate the ToolTip control, simply set the Active property to false.

    m_wndToolTip.Active = false;

    The attached demo project contains a simple form with two edit controls. One is for entering double type data and second is for entering integer type data. When you move the mouse over these controls, the tooltips for the corresponding controls will be displayed.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Naveen K Kohli


    Member

    Location: United States United States

    Other popular Miscellaneous articles:

    Article Top
    You must Sign In to use this message board.
    FAQ FAQ 
     
    Noise Tolerance  Layout  Per page   
     Msgs 1 to 5 of 5 (Total in Forum: 5) (Refresh)FirstPrevNext
    QuestionFor Delegate PinmemberDhaval S Shah19:40 24 Mar '07  
    GeneralHow about 'WithEvents PinsussAnonymous22:48 19 Oct '03  
    Generalmore to the tooltips topic Pinsussdmitri9:11 2 Nov '02  
    GeneralRe: more to the tooltips topic Pinmemberzitun6:44 27 Jan '09  
    Generalif you add a tooltips Pinmemberzjwuweim18:07 31 Aug '02  

    General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    PermaLink | Privacy | Terms of Use
    Last Updated: 1 Feb 2001
    Editor: Chris Maunder
    Copyright 2001 by Naveen K Kohli
    Everything else Copyright © CodeProject, 1999-2009
    Web17 | Advertise on the Code Project