# C1.Win.SuperTooltip.C1SuperTooltip.SetToolTip

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_" data-uid="C1.Win.SuperTooltip.C1SuperTooltip.SetToolTip*">SetToolTip Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_" data-uid="C1.Win.SuperTooltip.C1SuperTooltip.SetToolTip*"></a>
<h4 id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_System_Windows_Forms_Control_System_String_" data-uid="C1.Win.SuperTooltip.C1SuperTooltip.SetToolTip(System.Windows.Forms.Control,System.String)">SetToolTip(Control, string)</h4>
<div class="markdown level1 summary"><p>Associates tooltip HTML text with the specified control.</p>
<param name="control">The <b>Control</b> to associate the tooltip text with.
<param name="text">The tooltip text to display when the mouse cursor is over the control.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetToolTip(Control control, string text)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetToolTip(control As Control, text As String)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.control">Control</a></td>
      <td><span class="parametername">control</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_System_Windows_Forms_Control_System_String__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>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 <b>SetToolTip</b> 
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.</p>
<p>To determine the tooltip text that is associated with a control at run time, you can 
use the <a class="xref" href="C1.Win.SuperTooltip.C1SuperTooltip.GetToolTip.html#C1_Win_SuperTooltip_C1SuperTooltip_GetToolTip_System_Windows_Forms_Control_">GetToolTip(Control)</a> method.</p>
<p><a class="xref" href="C1.Win.SuperTooltip.C1SuperTooltip.html">C1SuperTooltip</a> can display HTML text, including cascading style sheets,
lists, tables, and images. To include images in your tooltips, use an &lt;img&gt; tag as
usual, for example:</p>
<pre><code class="lang-csharp">&lt;img src='[resourcename]'/&gt;</code></pre>
<p>where <pre><code class="lang-csharp">[resourcename]</code></pre> is the name of an embedded resource that
contains the image. The second example below illustrates this.
</div>
<h5 id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_System_Windows_Forms_Control_System_String__examples">Examples</h5>
<p>The code below associates an HTML snippet with a <b>ListBox</b> control. The HTML
contains two lines of text with some bold words in it.</p>
<pre><code class="lang-csharp">_C1SuperTooltip1.SetToolTip(this.listBox1,
  "This is a tip &lt;b&gt;with bold&lt;/b&gt; text in it&lt;br&gt;it is also multi-line...");</code></pre>
<p>The code below associates an HTML snippet with a <b>RichTextBox</b> 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.</p>
<pre><code class="lang-csharp">_C1SuperTooltip1.SetToolTip(richTextBox1,
  @"&lt;table&gt;&lt;tr&gt;
  &lt;td&gt;&lt;img src='tips.gif'/&gt;&lt;/td&gt;
  &lt;td&gt;This is a multiline&lt;br&gt;tooltip&lt;br&gt;&lt;b&gt;associated
  &lt;/b&gt;&lt;br&gt;with the rich text box...&lt;/td&gt;
  &lt;/tr&gt;&lt;/table&gt;");</code></pre>



<a id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_" data-uid="C1.Win.SuperTooltip.C1SuperTooltip.SetToolTip*"></a>
<h4 id="C1_Win_SuperTooltip_C1SuperTooltip_SetToolTip_System_Windows_Forms_ToolStripItem_System_String_" data-uid="C1.Win.SuperTooltip.C1SuperTooltip.SetToolTip(System.Windows.Forms.ToolStripItem,System.String)">SetToolTip(ToolStripItem, string)</h4>
<div class="markdown level1 summary"><p>Associates tooltip HTML text with the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.toolstripitem">ToolStripItem</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void SetToolTip(ToolStripItem item, string text)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub SetToolTip(item As ToolStripItem, text As String)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.forms.toolstripitem">ToolStripItem</a></td>
      <td><span class="parametername">item</span></td>
      <td><p>The <b>ToolStripItem</b> to associate the tooltip text with.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">text</span></td>
      <td><p>The tooltip text to display when the mouse cursor is over the control.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
