private void Button_clear_Click(object sender, RoutedEventArgs e) { MainText_0.Clear(); MainText_1.Clear(); Operation_textbox.Clear(); MainText_result.Clear(); }
private void Buttonravno_Click(object sender, RoutedEventArgs e) { try { for (; ;) { double j = Convert.ToDouble(MainText_1.Text); double i = Convert.ToDouble(MainText_0.Text); if (Operation_textbox.Text.Contains("+")) { Answer = $"{i}" + "+" + $"{j}"; MainText_1.Clear(); Operation_textbox.Clear(); MainText_result.Text = cl.Sum(i, j).ToString(); break; } else if (Operation_textbox.Text.Contains("-")) { Answer = $"{i}" + "-" + $"{j}"; MainText_1.Clear(); Operation_textbox.Clear(); MainText_result.Text += cl.Raznitsa(i, j).ToString(); break; } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Buttonplus_Click(object sender, RoutedEventArgs e) { Operation_textbox.Text = buttonplus.Content.ToString(); MainText_0.Text = MainText_1.Text; MainText_1.Clear(); if (MainText_result.Text.Contains(Answer) && MainText_1.Text.Contains("")) { Operation_textbox.Text = buttonplus.Content.ToString(); MainText_0.Text += MainText_result.Text; MainText_1.Clear(); } }
private void Buttonplus_Click(object sender, RoutedEventArgs e) { Double x = 0; Double y = 0; Operation_textbox.Text = buttonplus.Content.ToString(); if (Double.TryParse(MainText_0.Text, out x) && Double.TryParse(MainText_1.Text, out y)) { MainText_0.Text = cl.Sum(x, y).ToString(); MainText_1.Clear(); } else { MainText_0.Text = MainText_1.Text; MainText_1.Clear(); } }
private void Buttonminus_Click(object sender, RoutedEventArgs e) { Operation_textbox.Text = buttonminus.Content.ToString(); MainText_0.Text = MainText_1.Text; MainText_1.Clear(); }