Click here to Skip to main content
Click here to Skip to main content

How To Add ToolTips To Controls On A Windows Form

By , 1 Feb 2001
 
  • 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
    United States United States
    Member
    No Biography provided

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    GeneralMy vote of 3memberGeekforChrist13 Dec '12 - 16:16 
    It's good because of the code samples and it did help me but it is very much just standard documentation.
    GeneralMy vote of 5memberCesar Sampaio30 Aug '12 - 5:40 
    Helped me
    GeneralMy vote of 5memberDeveloper028 Sep '11 - 6:11 
    Justo lo que necesitaba, gracias.
    GeneralMy vote of 1memberFrancisco Moreno29 Jun '11 - 17:14 
    Nothing diferent from documentation.
    GeneralMy vote of 3memberpankaj8820 Jun '11 - 18:23 
    thanks.
    GeneralMy vote of 4memberpepe3w16 Mar '11 - 6:53 
    Good tip for me! Thanks!
    GeneralMy vote of 1memberammar11014 Nov '10 - 23:06 
    h
    GeneralMy vote of 4memberrwadew19 Oct '10 - 9:57 
    This article was concise and accurate. Thank you.
    R. Wade Williams
    rww@kirtly.com
    GeneralMy vote of 1memberKarstenK1 Sep '10 - 20:41 
    very little
    QuestionFor DelegatememberDhaval S Shah24 Mar '07 - 18:40 
    What is Delegate
    QuestionHow about 'WithEventssussAnonymous19 Oct '03 - 21:48 
    If I write :
    private WitEvents System.WinForms.ToolTip m_wndToolTip;
     
    whats the difference ?
    Generalmore to the tooltips topicsussdmitri2 Nov '02 - 8:11 
    Hi,
     
    I thought, you might be interested in further exploration of the tooltips topic. Here is a project: http://www.tooltips.net
     
    cheers,
    Dmitri

    GeneralRe: more to the tooltips topicmemberzitun27 Jan '09 - 5:44 
    This project is for html...
    Generalif you add a tooltipsmemberzjwuweim31 Aug '02 - 17:07 
    you will find it's easy to use tooltips for a Form.

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Permalink | Advertise | Privacy | Mobile
    Web03 | 2.6.130523.1 | Last Updated 2 Feb 2001
    Article Copyright 2001 by Naveen K Kohli
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid