blah blah blah is here! blah blah » Close
I need to be able to select, copy, and paste text in a windows form application.Can someone help me with this please?
When button1 is pressed, the following code selects all the text in textBox1, copies it to the clipboard and then pastes it to textBox2:
private void button1_Click(object sender, EventArgs e){ if (textBox1.Text.Length > 0) { textBox1.Focus(); textBox1.SelectAll(); Clipboard.Clear(); Clipboard.SetText(textBox1.SelectedText); textBox2.Text = Clipboard.GetText(); }}
answered 2 years ago by:
Got feedack? Found a bug? report it here.
1 answers
When button1 is pressed, the following code selects all the text in textBox1, copies it to the clipboard and then pastes it to textBox2:
answered 2 years ago by:
17279