Share via


How to: Create a Tooltip for a Control

This example programmatically creates a ToolTip for a Windows Forms control.

Example

private void Form1_Load(object sender, System.EventArgs e)
{
    System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
    ToolTip1.SetToolTip(this.textBox1, "Hello");
}

Compiling the Code

This example requires:

  • A form named Form1.

  • A TextBox control named textBox1.

  • The load event handler for Form1 set to Form1_Load.

See Also

Concepts

Designing a User Interface in Visual C#

Other Resources

Creating a Custom UI

Visual C# Guided Tour