Esempio n. 1
0
 private void btnOct_Click(object sender, EventArgs e)
 {
     textBox2.Text += textBox1.Text;
     if (CheckValidOctP(textBox2.Text) && textBox2.Text != string.Empty)
     {
         textBox1.Text = Programmer_Calculator.octal_arithmetic(textBox2.Text, '+');
     }
     else if (CheckValidOctM(textBox2.Text) && textBox2.Text != string.Empty)
     {
         textBox1.Text = Programmer_Calculator.octal_arithmetic(textBox2.Text, '-');
     }
     else if (CheckValidOctMul(textBox2.Text) && textBox2.Text != string.Empty)
     {
         textBox1.Text = Programmer_Calculator.octal_arithmetic(textBox2.Text, '*');
     }
     else if (CheckValidOctD(textBox2.Text) && textBox2.Text != string.Empty)
     {
         textBox1.Text = Programmer_Calculator.octal_arithmetic(textBox2.Text, '/');
     }
     else
     {
         MessageBox.Show("Invalid Input", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         textBox2.Text = textBox1.Text = string.Empty;
     }
 }
Esempio n. 2
0
 private void button10_Click(object sender, EventArgs e)
 {
     if (CheckValidHexa(textBox1.Text) && textBox1.Text != string.Empty)
     {
         textBox2.Text += textBox1.Text;
         textBox1.Text  = Programmer_Calculator.hexa_dec(textBox2.Text);
     }
     else
     {
         textBox1.Text = "";
         MessageBox.Show("Please Give the Input in Correct form", "Error Occurred", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
     }
 }