[]
        
(Showing Draft Content)

C1.Win.C1SuperTooltip.C1SuperTooltip.SetToolTip

SetToolTip Method

SetToolTip(Control, string)

Associates tooltip HTML text with the specified control.

The Control to associate the tooltip text with. The tooltip text to display when the mouse cursor is over the control.
Declaration
public void SetToolTip(Control control, string text)
Parameters
Type Name Description
Control control
string text
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 SetToolTip 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, you can use the GetToolTip(Control) method.

C1SuperTooltip can display HTML text, including cascading style sheets, lists, tables, and images. To include images in your tooltips, use an <img> tag as usual, for example:

<img src='[resourcename]'/>

where

[resourcename]
is the name of an embedded resource that contains the image. The second example below illustrates this.
Examples

The code below associates an HTML snippet with a ListBox control. The HTML contains two lines of text with some bold words in it.

_C1SuperTooltip1.SetToolTip(this.listBox1,
  "This is a tip <b>with bold</b> text in it<br>it is also multi-line...");

The code below associates an HTML snippet with a RichTextBox control. The HTML contains a table with two columns. The first column contains an image, loaded from the application's resources. In this case, the application must include an embedded resource named 'tips.gif'. The second column contains some formatted text.

_C1SuperTooltip1.SetToolTip(richTextBox1,
  @"<table><tr>
  <td><img src='tips.gif'/></td>
  <td>This is a multiline<br>tooltip<br><b>associated
  </b><br>with the rich text box...</td>
  </tr></table>");

SetToolTip(ToolStripItem, string)

Associates tooltip HTML text with the specified ToolStripItem.

Declaration
public void SetToolTip(ToolStripItem item, string text)
Parameters
Type Name Description
ToolStripItem item

The ToolStripItem to associate the tooltip text with.

string text

The tooltip text to display when the mouse cursor is over the control.