假设你点击button之后要截取textbox1的前4个字符到textbox2的话,就这样写 private void button1_Click(object sender, EventArgs e) { textBox2.Text = textBox1.Text.Substring(0,4) ; ///textBox1.Text.Substring(0,4) 表示从index为0开始,length为4的字符 }
string str1 = textBoxA.Text.substring(0,指定长度); TextBoxB.Text = str1; 谢谢采纳