コード例 #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;
            }
        }