title: Displaying tooltip on mouse hover of a text
body: <p>I want to display a tooltip when the mouse hovers over a link in my custom rich edit control. Consider the following text:</p>
  
  <blockquote>
    <p>We all <strong>sleep</strong> at night .</p>
  </blockquote>
  
  <p>In my case the word <strong><em>sleep</em></strong> is a link.</p>
  
  <p>When the user moves the mouse under the link, in this case "sleep", I want to display a tooltip for the link.</p>
  
  <p>The following came to my mind, but they are not working</p>
  
  <p>1) Trapping OnMouseHover </p>
  
  <pre><code>if(this.Cursor == Cursors.Hand)
     tooltip.Show(textbox,"My tooltip");
  else
     tooltip.Hide(textbox);
  </code></pre>
  
  <p>But this does not work out.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The links mentioned are <strong>not</strong> URLs, i.e these are custom links, so Regex won't be of much help here, it can be any text. The user can choose to create it a a link.</p>
  
  <p>Though I have not tried <code>GetPosition</code> method, I dont think it would be that elegant in terms of design and maintenance.</p>
  
  <p>Let me say I have the following line, in my richedit box </p>
  
  <blockquote>
    <p>We <strong><em>sleep</em></strong> at night. But the bats stay <strong><em>awake</em></strong>. Cockroaches become <strong><em>active</em></strong> at night.</p>
  </blockquote>
  
  <p>In the above sentence, I want three different tooltips, when the mouse hovers over them.</p>
  
  <pre><code>sleep -&gt; Human beings
  awake -&gt; Nightwatchman here
  active -&gt; My day begins
  </code></pre>
  
  <p>I trapped <code>OnMouseMove</code> as follows:</p>
  
  <p><strong>Working- with Messagebox</strong></p>
  
  <pre><code>OnMouseMove( )
  {
  
     // check to see if the cursor is over a link
     // though this is not the correct approach, I am worried why does not a tooltip show up
     if(this.Cursor.current == Cursors.hand )
     {
       Messagebox.show("you are under a link");
     }
  }
  </code></pre>
  
  <p><strong>Not Working - with Tooltip - Tooltip does not show up</strong></p>
  
  <pre><code>OnMouseMove( MouseventArgs e )
  {
  
     if(cursor.current == cursors.hand )
     {
       tooltip.show(richeditbox,e.x,e.y,1000);
     }
  }
  </code></pre>