Code: Creating a ToolTip for a Control (Visual C#)
TOC
Collapse the table of content
Expand the table of content

Code: Creating a ToolTip for a Control (Visual C#)

Visual Studio .NET 2003

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 with a TextBox control named textBox1. Set Form1's Load event handler to Form1_Load.

See Also

Windows Forms Example Topics

Show:
© 2016 Microsoft