Position TextBox Caret/Cursor to Same Line as Other Textbox C#
<p>I've been looking this up, but none of the methods I have tried worked. </p>

<p>I basically want to take the line the caret is on from one textbox, and scroll the second textbox to the same position. </p>

<p>This is what I tried:</p>

<pre><code>        int line = textBox1.GetLineFromCharIndex(textBox1.SelectionStart);
        Point pNew = new Point();
        pNew.X = 0;
        pNew.Y = line;
        textBox2.SelectionStart = textBox2.GetCharIndexFromPosition(pNew);
        textBox2.ScrollToCaret();
</code></pre>

<p>All I want to do is keep the second textbox as scrolled as much as the first textbox. </p>
