예제 #1
0
 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();
     }
 }
예제 #2
0
        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];
            }
        }
예제 #3
0
        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;
            }
        }