Windows form applciation - text Highlighting
<p>I am using a WFA which has a <em>ToolStripMenuItem</em> that is supposed to search for a word in a textBox and highlight it. This is the highlighting code.</p>

<p>first = first index to be highlighted
, length= number of characters to be highlighted.</p>

<pre><code>            textBox2.SelectionStart = first;
            textBox2.SelectionLength = length;
            //scroll to the caret
            textBox2.ScrollToCaret();
</code></pre>

<p>everything seems to be working well. However, If the mouse cursor isn't inside textBox2 (say in another textBox). The highlighting doesn't work. Is there a way to make it work regardless of the position of the mouse cursor? in other words, is there a way to change my code to make it highlight the text in textBox2 even if the mouse cursor wasn't inside textBox2 before hitting the <em>ToolStripMenuItem</em>?</p>

<p>Thanks!</p>

<p>P.S. It's worth mentioning that I am using c# in VS 2010</p>
