locked
MultiLine ToolTips RRS feed

  • Question

  • Somewhere in the Help I happened to notice that ToolTips can be customized to show multiline text. Now, when I need it, I can't find the appropriate help text. How can this be done?
    Saturday, May 21, 2005 3:56 PM

Answers

  • I tried the method above, and it's telling me that  .Show is not a member of  System.Windows.Forms.ToolTip .

    I did it this way, and it works great:

    Of course, add the ToolTip control to your project.
    Assign your ToolTip text to the control's ToolTip in the Properties dialog.
    In the Form Designer Generated Code, find the control you want the to make multiline (you can search for part or all of the text you just added in the Properties).  Add the following (in blue bold)to the ToolTip line that was just generated when you added your ToolTip text, and be sure to remove the space from between your lines of text so it's aligned properly:



    Me.ToolTip1.SetToolTip(Me.btnDelete, "WARNING!  This will permanently delete the" & Environment.NewLine & "current record being displayed.")

     

    Saturday, May 21, 2005 4:56 PM
  • Hi Erik,

    Here is a good snippet on how to achieve it:
    Creating multiline tooltips

    Regards,
    Vikram
    Saturday, May 21, 2005 5:26 PM

All replies

  • Hi,


    In the toolbar just add the ToolTip control...
    to show it, just call the ToolTip.Show() method...
    For multi-line... try using this:
    toolTip1.Show("My Name is\nPaul June A. Domag", this, 100, 100);




    cheers,



    Paul June A. Domag
    Saturday, May 21, 2005 4:05 PM
  • I tried the method above, and it's telling me that  .Show is not a member of  System.Windows.Forms.ToolTip .

    I did it this way, and it works great:

    Of course, add the ToolTip control to your project.
    Assign your ToolTip text to the control's ToolTip in the Properties dialog.
    In the Form Designer Generated Code, find the control you want the to make multiline (you can search for part or all of the text you just added in the Properties).  Add the following (in blue bold)to the ToolTip line that was just generated when you added your ToolTip text, and be sure to remove the space from between your lines of text so it's aligned properly:



    Me.ToolTip1.SetToolTip(Me.btnDelete, "WARNING!  This will permanently delete the" & Environment.NewLine & "current record being displayed.")

     

    Saturday, May 21, 2005 4:56 PM
  • Hi Erik,

    Here is a good snippet on how to achieve it:
    Creating multiline tooltips

    Regards,
    Vikram
    Saturday, May 21, 2005 5:26 PM
  • Hi,


    Just browsed the document. the .Show() method is only available in VB.Net 2005...
    http://msdn2.microsoft.com/library/c85ff5s9(en-us,vs.80).aspx





    cheers,


    Paul June A. Domag
    Saturday, May 21, 2005 5:42 PM
  • Thanks for the answers! It was just too obvious for me to see. Now I have implemented a version that matches my needs; I just set the controls ToolTipText = "This is a" & Environment.NewLine & "multiline tooltip"
    Saturday, May 21, 2005 7:21 PM