Quantcast
Channel: User BobbyShaftoe - Stack Overflow
Viewing all articles
Browse latest Browse all 45

Answer by BobbyShaftoe for How can I show a tooltip on a disabled button?

$
0
0

So assuming your control is called button1 you could do something like this.
You have to do it by handling the MouseMove event of your form since the events won't be fired from your control.

bool IsShown = false;      void Form1_MouseMove(object sender, MouseEventArgs e){   Control ctrl = this.GetChildAtPoint(e.Location);   if (ctrl != null)   {       if (ctrl == this.button1 && !IsShown)       {           string tipstring = this.toolTip1.GetToolTip(this.button1);                            this.toolTip1.Show(tipstring, this.button1, this.button1.Width /2,                                                        this.button1.Height / 2);           IsShown = true;       }   }   else   {       this.toolTip1.Hide(this.button1);       IsShown = false;   }

}


Viewing all articles
Browse latest Browse all 45

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>