Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Remove ToolTip from a special control

Remove ToolTip from a special control

Scheduled Pinned Locked Moved C#
questionhelp
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    C Scharbe
    wrote on last edited by
    #1

    hi, how can i remove a tooltip from a control? my problem is i have a textchanged event, that should set a tooltip to an picture box by: toolTip.SetToolTip(targetControl, caption); --> the tooltip change with the content in the textbox, so when i execute again the SetToolTip function a new tooltip will be created, but the old one is already existing. thats why i am looking for a function to remove the old tooltip...

    S R C P 4 Replies Last reply
    0
    • C C Scharbe

      hi, how can i remove a tooltip from a control? my problem is i have a textchanged event, that should set a tooltip to an picture box by: toolTip.SetToolTip(targetControl, caption); --> the tooltip change with the content in the textbox, so when i execute again the SetToolTip function a new tooltip will be created, but the old one is already existing. thats why i am looking for a function to remove the old tooltip...

      S Offline
      S Offline
      Schmullus
      wrote on last edited by
      #2

      Hi, normally, this should work: private void textBox1_TextChanged(object sender, EventArgs e) { toolTip1.SetToolTip(pictureBox1, textBox1.Text); //toolTip1.RemoveAll(); } I created a picturebox named 'pictureBox1' and placed the above code within the text-change eventhandler of my textbox 'textBox1'. Anytime I changed the text the tooltip will be updated. There are no multiple tooltips on the picturebox. Maybe try the method RemoveAll() of toolTip1. Regards Erik

      B C 2 Replies Last reply
      0
      • S Schmullus

        Hi, normally, this should work: private void textBox1_TextChanged(object sender, EventArgs e) { toolTip1.SetToolTip(pictureBox1, textBox1.Text); //toolTip1.RemoveAll(); } I created a picturebox named 'pictureBox1' and placed the above code within the text-change eventhandler of my textbox 'textBox1'. Anytime I changed the text the tooltip will be updated. There are no multiple tooltips on the picturebox. Maybe try the method RemoveAll() of toolTip1. Regards Erik

        B Offline
        B Offline
        Bhupi Bhai
        wrote on last edited by
        #3

        Set the "AutoPopDelay" property of ToolTip. Regards, Bhupi Bhai.

        1 Reply Last reply
        0
        • C C Scharbe

          hi, how can i remove a tooltip from a control? my problem is i have a textchanged event, that should set a tooltip to an picture box by: toolTip.SetToolTip(targetControl, caption); --> the tooltip change with the content in the textbox, so when i execute again the SetToolTip function a new tooltip will be created, but the old one is already existing. thats why i am looking for a function to remove the old tooltip...

          R Offline
          R Offline
          rah_sin
          wrote on last edited by
          #4

          i think it will be better if u create tooltip object runtime and on the textchange event u can dispose the old tool tip object by toolTip.Diapose() method and create new instance of tooltip object and set it again.

          rahul

          1 Reply Last reply
          0
          • S Schmullus

            Hi, normally, this should work: private void textBox1_TextChanged(object sender, EventArgs e) { toolTip1.SetToolTip(pictureBox1, textBox1.Text); //toolTip1.RemoveAll(); } I created a picturebox named 'pictureBox1' and placed the above code within the text-change eventhandler of my textbox 'textBox1'. Anytime I changed the text the tooltip will be updated. There are no multiple tooltips on the picturebox. Maybe try the method RemoveAll() of toolTip1. Regards Erik

            C Offline
            C Offline
            C Scharbe
            wrote on last edited by
            #5

            Ok, my problem is i even don't have any reference to the tooltip object.

            1 Reply Last reply
            0
            • C C Scharbe

              hi, how can i remove a tooltip from a control? my problem is i have a textchanged event, that should set a tooltip to an picture box by: toolTip.SetToolTip(targetControl, caption); --> the tooltip change with the content in the textbox, so when i execute again the SetToolTip function a new tooltip will be created, but the old one is already existing. thats why i am looking for a function to remove the old tooltip...

              C Offline
              C Offline
              C Scharbe
              wrote on last edited by
              #6

              ok i tried to aviod creating a tooltip object thats existing the whole time in the class, but there is no alternative, i think. thank you

              1 Reply Last reply
              0
              • C C Scharbe

                hi, how can i remove a tooltip from a control? my problem is i have a textchanged event, that should set a tooltip to an picture box by: toolTip.SetToolTip(targetControl, caption); --> the tooltip change with the content in the textbox, so when i execute again the SetToolTip function a new tooltip will be created, but the old one is already existing. thats why i am looking for a function to remove the old tooltip...

                P Offline
                P Offline
                Psytechnic
                wrote on last edited by
                #7

                This explains quite well that if you perform toolTip.SetToolTip(targetControl, caption); and the control already has a caption, then this will be overwrote. It will not just add a new one. http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.settooltip.aspx[^]

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups