How to paste text in textbox current cursor?

前端 未结 9 840
灰色年华
灰色年华 2020-12-30 19:23

How do you paste text into a TextBox at the current cursor position in Windows Forms?

Not textbox1 += string

9条回答
  •  执笔经年
    2020-12-30 19:41

    try this code:

     string insertText = "Text";
                textBox1.Text = textBox1.Text+ insertText;
                textBox1.SelectionStart = textBox1.Text.Length +1;
    

提交回复
热议问题