¿Cómo eliminar el último carácter de un cuadro de texto mediante programación en C# WinForm?
Darle un código de principio básico
void Button1Click(object sender, EventArgs e)
{
string strNew = this.textBox1.Text.Substring(0, this.textBox1.Text.Length-1);
this.textBox1.Text = strNew;
this.textBox1.SelectionStart = this.textBox1.Text.Length;
p>
this.textBox1.Text.Length = this.textBox1.SelectionStart;
this..textBox1.Focus()
}
Lo principal es establecer la propiedad SelectionStart y dejar que el cuadro de texto obtenga el foco.
Lo principal es establecer la propiedad SelectionStart y dejar que el cuadro de texto obtenga el foco.