// "DEL" Button private void C_Button_Click(object sender, EventArgs e) { // if condition if (Principal.Text.Length > 1) { Principal.Text = Principal.Text.Remove(Principal.Text.Length - 1, 1); } // else else { Principal.Clear(); // Empty / Clear the TextBox } }
// "-" Button private void Sust_Button_Click(object sender, EventArgs e) { operation = "-"; num1 = Convert.ToDouble(Principal.Text); Principal.Clear(); }
// "10x" Button private void Tentox_Button_Click(object sender, EventArgs e) { operation = "10x"; Principal.Clear(); }