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?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Just to share my idea...
I created a custom class to inherit the Label class. I added a private variable assigned as a Tooltip class and a public property, TooltipText. Then, gave it a MouseEnter delegate method. This is an easy way to work with multiple Label controls and not have to worry about assigning your Tooltip control for each Label control.
In the form or user control's InitializeComponent method (the Designer code), reassign your Label control to the custom class:
Also, change the private variable reference in the Designer code:
just another way to do it.
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 namedtoolTip1
: