Just to share your idea ...
I created my own class to inherit the Label class. I added a private variable assigned as the Tooltip class and the public property of TooltipText. Then he gave it the MouseEnter delegate method. This is an easy way to work with multiple Label controls, and you donβt have to worry about assigning a Tooltip control to each Label control.
public partial class ucLabel : Label { private ToolTip _tt = new ToolTip(); public string TooltipText { get; set; } public ucLabel() : base() { _tt.AutoPopDelay = 1500; _tt.InitialDelay = 400;
In a form or custom InitializeComponent method (constructor code), reassign the Label control to a user class:
this.lblMyLabel = new ucLabel();
Also change the link to the private variable in the constructor code:
private ucLabel lblMyLabel;
cChacon Mar 09 '16 at 1:10 2016-03-09 01:10
source share