How can I add a hint or tooltip to a label in C# Winforms?

前端 未结 5 2045
不知归路
不知归路 2021-01-31 06:43

It seems that the Label has no Hint or ToolTip or Hovertext property. So what is the preferred method to show a hint, tooltip

5条回答
  •  粉色の甜心
    2021-01-31 07:25

    yourToolTip = new ToolTip();
    //The below are optional, of course,
    
    yourToolTip.ToolTipIcon = ToolTipIcon.Info;
    yourToolTip.IsBalloon = true;
    yourToolTip.ShowAlways = true;
    
    yourToolTip.SetToolTip(lblYourLabel,"Oooh, you put your mouse over me.");
    

提交回复
热议问题