How do I remove a tooltip currently bound to a control?

前端 未结 6 1927
北荒
北荒 2020-12-20 12:12

I\'m currently adding a tooltip to a label like so:

ToolTip LabelToolTip = new System.Windows.Forms.ToolTip();
LabelToolTip.SetToolTip(this.LocationLabel, te         


        
6条回答
  •  不思量自难忘°
    2020-12-20 12:44

    The tooltip object works in multiple Controls at the same time.

    Create a single instance of the ToolTip and use it for adding and removing a ToolTip of any Control.

    When adding you should simply use .SetToolTip(Control, "Message that will apear when hover") When removing you just set it back to null with .SetToolTip(Control, null).

提交回复
热议问题