Search code examples
.netuser-interfaceevent-handlingtooltipmenuitem

Displaying tooltips on disabled menu items or alternative solutions in .NET


I'm trying to display a tooltip on a disabled ToolStripMenuItem, to inform the user why it is disabled.

My initial thought was (as events don't get fired on disabled controls) to pick up the MouseMove event on the parent MenuStrip instead and display the tooltip if over a disabled control. But the event doesn't seem to propagate up the parent MenuStrip as expected. This is how it works usually right? Example, a disabled textbox events would move up to the parent panel?

PS. I'm starting to think this bad idea UI design anyway? What's a better way to do it?


Solution

  • Tricky. I'd either accept that it's not possible to tell users (most users these days are happy that sometimes options are disabled because of context/selected data etc). Alternatively, you have to enable these items, and display popups or other warning messages when users try to invoke them.