private void button1_Click(object sender, EventArgs e)
{
this.textBox1.Focus();
SendKeys.Send("{PGDN}");
SendKeys.Send("+{HOME}");
SendKeys.Send("+{DEL}");
}
删除最后一行,纯正退位键实现
这个需要退位键吗,你可以借助API sendkey,好像是的,或者最简单的方法:
textbox.text=textbox.text.substring(0,textbox.text.length-1-2);
个字符?
string test = textbox.Text;
if (!string.IsNullOrEmpty(test))
{
test = test.Substring(0, test.Length - 1);
}
textbox.Text = test;