How can I show a tooltip on a disabled button?

Place the button (or any control that fits this scenario) in a container (panel, tableLayoutPanel), and associate the tooltip to the appropriate underlying panel cell. Works great in a number of scenarios, flexible. Tip: make the cell just large enough to hold the bttn, so mouseover response (tooltip display) doesn't appear to "bleed" outside the bttn borders.


I have since adapted BobbyShaftoe's answer to be a bit more general

Notes:

  • The MouseMove event must be set on the parent control (a panel in my case)

    private void TimeWorks_MouseMove(object sender, MouseEventArgs e)
    {
        var parent = sender as Control;
        if (parent==null)
        {
            return;
        }
        var ctrl = parent.GetChildAtPoint(e.Location);
        if (ctrl != null && !ctrl.Enabled)
        {
            if (ctrl.Visible && toolTip1.Tag==null)
            {
                var tipstring = toolTip1.GetToolTip(ctrl);
                toolTip1.Show(tipstring, ctrl, ctrl.Width / 2, ctrl.Height / 2);
                toolTip1.Tag = ctrl;
            }
        }
        else
        {
            ctrl = toolTip1.Tag as Control;
            if (ctrl != null)
            {
                toolTip1.Hide(ctrl);
                toolTip1.Tag = null;
            }
        }
    
    }
    

Tags:

C#

.Net

Winforms