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. Tooltips on disabled controls

Tooltips on disabled controls

Scheduled Pinned Locked Moved C#
csharpwpfhelpquestion
5 Posts 3 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.
  • J Offline
    J Offline
    jchalfant
    wrote on last edited by
    #1

    All of us have probably ran into this before. You disable a control for some reason or another and would like to let the user know what they did to make this control turn grey or what they can do to enable it again. Sadly, doing it with a tooltip in one or two lines of code is right out because the OnMouseEnter method checks the ButtonBase state for certain flags before rendering the tool tip. I tried dancing with this problem today by overloading the CheckBox control and forcing the OnMouseEnter function to fire. I realized, then that I had to overload ButtonBase as well. Not wanting to rewrite an entire class in the framework, I decided to use the old fallback of using the MouseMove event and checking its location. That was my solution for this today. Anyone ever find a better solution? I hear WPF has built in support for this sort of thing.

    R 1 Reply Last reply
    0
    • J jchalfant

      All of us have probably ran into this before. You disable a control for some reason or another and would like to let the user know what they did to make this control turn grey or what they can do to enable it again. Sadly, doing it with a tooltip in one or two lines of code is right out because the OnMouseEnter method checks the ButtonBase state for certain flags before rendering the tool tip. I tried dancing with this problem today by overloading the CheckBox control and forcing the OnMouseEnter function to fire. I realized, then that I had to overload ButtonBase as well. Not wanting to rewrite an entire class in the framework, I decided to use the old fallback of using the MouseMove event and checking its location. That was my solution for this today. Anyone ever find a better solution? I hear WPF has built in support for this sort of thing.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Tooltips seem to render fine for me on disabled controls. /ravi

      My new year resolution: 2048 x 1536 Home | Music | Articles | Freeware ravib(at)ravib(dot)com

      J 1 Reply Last reply
      0
      • R Ravi Bhavnani

        Tooltips seem to render fine for me on disabled controls. /ravi

        My new year resolution: 2048 x 1536 Home | Music | Articles | Freeware ravib(at)ravib(dot)com

        J Offline
        J Offline
        jchalfant
        wrote on last edited by
        #3

        Hmm, are you running 3.0? If so, that's one more reason to migrate.

        R 1 Reply Last reply
        0
        • J jchalfant

          Hmm, are you running 3.0? If so, that's one more reason to migrate.

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          3.5 actually. /ravi

          My new year resolution: 2048 x 1536 Home | Music | Articles | Freeware ravib(at)ravib(dot)com

          U 1 Reply Last reply
          0
          • R Ravi Bhavnani

            3.5 actually. /ravi

            My new year resolution: 2048 x 1536 Home | Music | Articles | Freeware ravib(at)ravib(dot)com

            U Offline
            U Offline
            User 4419137
            wrote on last edited by
            #5

            How is that possible unless you have custom code. From msdn for 3.5: ToolTip text is not displayed for controls that are disabled.

            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