Tooltips on disabled controls
-
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.
-
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.
-
-
How is that possible unless you have custom code. From msdn for 3.5: ToolTip text is not displayed for controls that are disabled.