private void buttonBackspace_Click(object sender, EventArgs e) { int n = this.textBox.Text.Length; if (n == 1) this.textBox.Text = "0"; else if (n > 0) this.textBox.Text = this.textBox.Text.Substring(0, n - 1); }