C# Copy-paste multiple times not working
<p>In Visual C#, I'm trying to take text from multiple textboxes (one at a time) and paste them into Notepad. I do this by copying to the clipboard, alt-tabbing, and then pasting into notepad...then again for the other textboxes. This code represents this idea:</p>

<pre><code>subBox1.SelectAll();
subBox1.Copy();
SendKeys.Send("%{TAB}");    // alt+tab
SendKeys.Send("^v");        // paste
SendKeys.Send("{TAB}");     // tab

subBox2.SelectAll();
subBox2.Copy();
SendKeys.Send("^v");
SendKeys.Send("{TAB}");

subBox3.SelectAll();
subBox3.Copy();
SendKeys.Send("^v");
SendKeys.Send("{TAB}");
</code></pre>

<p>As you can see, this copies and pastes from three textboxes (named subBox1, 2, and 3). But, for some reason, only the last textbox's contents are getting copied over. This also happens if I comment out the third box...in that case, only the second textbox's content gets copied over. I've tried using the SelectAll() and Copy() as you see here, as well as the Clipboard class. Both have the same issue.</p>

<p>For example, if the textbox contents are "asdf", "qwer", and "zxcv" respectively, all I see is "zxcv" three times.</p>

<p>Any idea why this is happening? I've been stuck on this for about an hour now and have no idea what's going on.</p>

<p>Thanks a ton!</p>
