Search code examples
c#checkboxtooltipc#-3.0

Forcefully show tooltip on "Enable=false" control


How to forcefully show tooltip on "Enable=false" control.

I have a checkbox which is enabled false but i want to still show tooltip on it. is there any way to achieve this?

Thanks in advance


Solution

  • Not from the CheckBox control itself, it will no longer receive any mouse messages. Its Parent will now get them. Which gives you a hack around this restriction:

        private void Form1_MouseMove(object sender, MouseEventArgs e) {
            if (checkBox1.Bounds.Contains(e.Location)) {
                toolTip1.Show("yadayada", this);
            }
        }
    

    Strictly for entertainment, I have to recommend that you don't do this.