Пример #1
0
 private void ButtonSqurt_Click(object sender, RoutedEventArgs e)
 {
     PreviousNum       = Math.Sqrt(double.Parse(TotalTextBox.Text));
     TotalTextBox.Text = Math.Round(PreviousNum, 10).ToString();
     PreviewTextBox.Clear();
     PreviewTextBox.Visibility = Visibility.Hidden;
 }
Пример #2
0
 private void ButtonPower2_Click(object sender, RoutedEventArgs e)
 {
     PreviousNum       = Math.Pow(double.Parse(TotalTextBox.Text), 2);
     TotalTextBox.Text = PreviousNum.ToString();
     PreviewTextBox.Clear();
     PreviewTextBox.Visibility = Visibility.Hidden;
 }
Пример #3
0
 private void ButtonTotal_Click(object sender, RoutedEventArgs e)
 {
     PreviewTextBox.Clear();
     Calculate();
     isTotal                    = true;
     PreviousNum                = 0;
     CurrentNum                 = double.Parse(TotalTextBox.Text);
     DecimalPlaces              = 12;
     PreviewTextBox.Visibility  = Visibility.Hidden;
     OperatorTextBox.Visibility = Visibility.Hidden;
 }
Пример #4
0
 private void ButtonClear_Click(object sender, RoutedEventArgs e)
 {
     TotalTextBox.Text = "0";
     Op     = "";
     HaveOp = false;
     OperatorTextBox.Clear();
     PreviewTextBox.Clear();
     PreviousNum = 0;
     CurrentNum  = 0;
     OperatorTextBox.Visibility = Visibility.Hidden;
     PreviewTextBox.Visibility  = Visibility.Hidden;
     InvalidTextBox.Visibility  = Visibility.Hidden;
 }
Пример #5
0
        private void ButtonTan_Click(object sender, RoutedEventArgs e)
        {
            PreviousNum = double.Parse(TotalTextBox.Text);
            double Rad = PreviousNum * (Math.PI / 180);

            CurrentNum = Math.Round(Math.Tan(Rad), 10);
            if (PreviousNum == 90 || PreviousNum == 270)
            {
                InvalidTextBox.Visibility = Visibility.Visible;
                TotalTextBox.Text         = "0";
                PreviousNum = 0;
                PreviewTextBox.Clear();
                PreviewTextBox.Visibility = Visibility.Hidden;
            }
            else
            {
                TotalTextBox.Text   = CurrentNum.ToString();
                PreviewTextBox.Text = "tan(" + PreviousNum.ToString() + ")";
                PreviousNum         = CurrentNum;
            }
        }