How to move the textbox viewport when gaining focus?
<p>I have a textbox that may contain strings larger than the textbox size. When I'm typing, the textbox "viewport" always  moves to show the last character I typed (for example when you write a very large title in a SO question).
a</p>

<p>The problem is that if the texbox loses focus, when it is focused again the viewport always is set at the start of the text, and I want it at the end.</p>

<p>I tried moving the caret programatically to the end of the text and it works, but the viewport is still at the beginning of the text, so the user still has to press any key to move the viewport to the end of the text.</p>

<p><strong>Example</strong></p>

<p>This is the textbox before losing focus:</p>

<p><img src="http://img35.imageshack.us/img35/6697/10437837.jpg" alt="alt text"></p>

<p>And this after focus is lost:</p>

<p><img src="http://img11.imageshack.us/img11/1390/33816597.jpg" alt="alt text"></p>

<p>I'd like that when the txtbox gains focus again the viewport is set like in the first image.</p>

<p>Is possible to do this ?</p>
