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. Problem with tooltip

Problem with tooltip

Scheduled Pinned Locked Moved C#
helpcsharpquestion
7 Posts 4 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.
  • R Offline
    R Offline
    rajeev82
    wrote on last edited by
    #1

    Hi all, I've created a simple windows application in C# and added a button to the form and associated a tooltip to the button.The problem is the tooltip is not showing up if i click on the button.(i.e)the tooltip is getting displayed properly n number of times before i click on the button, but it doesnt show up after i click on it.. :sigh: wat could be the problem here??any help will be highly appreciated :-D thanks and regards, raj

    M C 2 Replies Last reply
    0
    • R rajeev82

      Hi all, I've created a simple windows application in C# and added a button to the form and associated a tooltip to the button.The problem is the tooltip is not showing up if i click on the button.(i.e)the tooltip is getting displayed properly n number of times before i click on the button, but it doesnt show up after i click on it.. :sigh: wat could be the problem here??any help will be highly appreciated :-D thanks and regards, raj

      M Offline
      M Offline
      mihai123
      wrote on last edited by
      #2

      i think that you have the focus on that button and if so the tooltip doesn't appears anymore. Try to remove the focus form the button maybe it works.

      1 Reply Last reply
      0
      • R rajeev82

        Hi all, I've created a simple windows application in C# and added a button to the form and associated a tooltip to the button.The problem is the tooltip is not showing up if i click on the button.(i.e)the tooltip is getting displayed properly n number of times before i click on the button, but it doesnt show up after i click on it.. :sigh: wat could be the problem here??any help will be highly appreciated :-D thanks and regards, raj

        C Offline
        C Offline
        cocoonwls
        wrote on last edited by
        #3

        Hi raj, My suggestion is you may add a mouse hover event on that button.When move over the button then fire event to show up what you want to display. example, public ToolTip tooltip=new ToolTip(); public Form1() { InitializeComponent(); button1.MouseHover += new EventHandler(showTooltips); } private void showTooltips(object sender, EventArgs e) { tooltip.ShowAlways = true; // Set up the ToolTip text for the Button . tooltip.SetToolTip((Button)sender, "50"); } from the example, when you click on button,it will display '50' Hope this help you. regard cocoon

        modified on Wednesday, April 16, 2008 4:40 AM

        R 1 Reply Last reply
        0
        • C cocoonwls

          Hi raj, My suggestion is you may add a mouse hover event on that button.When move over the button then fire event to show up what you want to display. example, public ToolTip tooltip=new ToolTip(); public Form1() { InitializeComponent(); button1.MouseHover += new EventHandler(showTooltips); } private void showTooltips(object sender, EventArgs e) { tooltip.ShowAlways = true; // Set up the ToolTip text for the Button . tooltip.SetToolTip((Button)sender, "50"); } from the example, when you click on button,it will display '50' Hope this help you. regard cocoon

          modified on Wednesday, April 16, 2008 4:40 AM

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

          well i dont want the tooltip to be displayed on click of the button.It should get displayed when the mouse pointer is idle over it for some time.

          E C 2 Replies Last reply
          0
          • R rajeev82

            well i dont want the tooltip to be displayed on click of the button.It should get displayed when the mouse pointer is idle over it for some time.

            E Offline
            E Offline
            Expert Coming
            wrote on last edited by
            #5

            His code does just that.

            The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

            1 Reply Last reply
            0
            • R rajeev82

              well i dont want the tooltip to be displayed on click of the button.It should get displayed when the mouse pointer is idle over it for some time.

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

              hi raj, I have modified it to mouse hover event. Please check it again.

              R 1 Reply Last reply
              0
              • C cocoonwls

                hi raj, I have modified it to mouse hover event. Please check it again.

                R Offline
                R Offline
                rajeev82
                wrote on last edited by
                #7

                Thanks for your help..it works now :-D

                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