How to get or set a SuperToolTip programmatically in Windows Forms SuperToolTip(Classic)

9 Dec 2019 / 1 minute to read

We can get or set the SuperToolTip programmatically using the below two methods.

SuperToolTip Method Description
GetToolTip Gets the ToolTipInfo for any control. If the ToolTip properties change dynamically in an application, you can use this method to find out what information is exhibited at any point, depending upon the state of the application.
SetToolTip Sets the ToolTipInfo for any control.
private void buttonAdv1_Click(object sender, EventArgs e) 
{ 
// Gets the text set for the Body of TextBox tooltip. 
    MessageBox.Show (this.superToolTip1.GetToolTip(this.textBox1).Body.Text.ToString ()); 
}  

// To add a ToolTip through code. 
this.superToolTip1.SetToolTip(this.textBox1, "ToolTipText");
Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As EventArgs) 

' Gets the text set for the Body of TextBox tooltip. 
MessageBox.Show(Me.superToolTip1.GetToolTip(Me.textBox1).Body.Text.ToString) 
End Sub  

' To add a ToolTip through code. 
Me.superToolTip1.SetToolTip(Me.textBox1, "ToolTipText")

How-to-get-or-set-a-SuperToolTip-programmatically_img1

How-to-get-or-set-a-SuperToolTip-programmatically_img2

NOTE

You can also set tooltip using_ UpdateToolTip Event