2015/10/22

add a hint or tooltip to a label in C# Winforms

It seems that the Label has no Hint or ToolTip or Hovertext property. So what is the preferred method to show a hint, tooltip, or hover text when the Label is approached by the mouse?


You have to add a ToolTip control to your form first. Then you can set the text it should display for other controls.
Here's a screenshot showing the designer after adding a ToolTip control which is named toolTip1:

yourToolTip.SetToolTip(lblYourLabel,"Oooh, you put your mouse over me.");

沒有留言:

張貼留言