private void Cbtn_Click(object sender, EventArgs e) { if (num1 == 0 && Screentxt.TextLength > 0) { num1 = 0; Screentxt.Clear(); } else if (num1 > 0 && Screentxt.TextLength > 0) { Screentxt.Clear(); } }
private void DELbtn_Click(object sender, EventArgs e) { int lenght = Screentxt.TextLength - 1; string text = Screentxt.Text; Screentxt.Clear(); for (int i = 0; i < lenght; i++) { Screentxt.Text = Screentxt.Text + text[i]; } }
private void Dotbtn_Click(object sender, EventArgs e) { if ((Screentxt.Text == "0") || (isOperationPerformed)) { Screentxt.Clear(); } isOperationPerformed = false; Button button = (Button)sender; if (button.Text == ".") { if (!Screentxt.Text.Contains(".")) { Screentxt.Text = Screentxt.Text + button.Text; } } else { Screentxt.Text = Screentxt.Text + button.Text; } }