System.Windows.Forms.ToolTip.SetToolTip Method

Associates ToolTip text with the specified control.

Syntax

public void SetToolTip (Control control, string caption)

Parameters

control
The System.Windows.Forms.Control to associate the ToolTip text with.
caption
The ToolTip text to display when the pointer is on the control.

Remarks

In addition to specifying the ToolTip text to display for a control, you can also use this method to modify the ToolTip text for a control. Calling the ToolTip.SetToolTip(Control, string) method more than once for a given control does not specify multiple ToolTip text to display for a control, but instead changes the current ToolTip text for the control. To determine the ToolTip text that is associated with a control at run time, use the ToolTip.GetToolTip(Control) method.

As a general rule the text used should be short; however, you can insert line breaks by using the \r\n escape character sequence. Ampersands (&) in the text are handled as described by the ToolTip.StripAmpersands property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0