8

I have a simple question ! I'd like to know how to add like a tip when the user puts his mouse over a button, like that like grey box that appears right below the button. I'm using Windows Form !

P.S-> I know it's obsolete and we now have WPF but I'm using Form !

Thanks !

4

1 回答 1

29

Use ToolTip on the button. Like.

System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.Button1, "Button Info");

Or you can:
Add a ToolTip control to your form, Name it ToolTip1.
Add text for tooltip to the "ToolTip on ToolTip1" property of the button.

于 2012-07-04T05:21:47.150 回答