private void Separation_Click(object sender, RoutedEventArgs e) { d = 4; s1 = WriteText.Text; WriteText.Clear(); WriteD.Text = s1 + " / "; }
private void Send_Click(object sender, EventArgs e) { //テキストが入力されていないとき抜け出します if (WriteText.Text == "") { Send.Enabled = true; return; } //ボタン押下できないようにする Send.Enabled = false; //おくれなかったとき if (!appif.SendText(WriteText.Text)) { WriteText.Clear(); Send.Enabled = true; return; } DisplayMessage(WriteText.Text, 1); //テキストを送ったら削除する。 WriteText.Clear(); Send.Enabled = true; }
private void Multiplication_Click(object sender, RoutedEventArgs e) { d = 3; s1 = WriteText.Text; WriteText.Clear(); WriteD.Text = s1 + " * "; }
private void Minus_Click(object sender, RoutedEventArgs e) { d = 2; s1 = WriteText.Text; WriteText.Clear(); WriteD.Text = s1 + " - "; }
private void Roots_Click(object sender, RoutedEventArgs e) { //d = 7; s = 7; r = WriteText.Text; string s4; if (WriteText.Text == "") { string Error = null; WriteText.Text = (Error); } else { if (d == 1) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); WriteD.Text = s1 + " + " + "√" + Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); } else if (d == 2) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); WriteD.Text = s1 + " - " + "√" + Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); } else if (d == 3) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); WriteD.Text = s1 + " * " + "√" + Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); } else if (d == 4) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); WriteD.Text = s1 + " / " + "√" + Convert.ToString(Math.Sqrt(Convert.ToDouble(s4))); } else { WriteD.Text = " √ " + r; double a = Convert.ToDouble(r); a = Math.Sqrt(a); WriteText.Text = Convert.ToDouble(a).ToString(); } } }
private void _1_x_Click(object sender, RoutedEventArgs e) { // d = 6; s = 6; string s4; double one = 1; if (WriteText.Text == "") { string Error = null; WriteText.Text = (Error); } else { if (d == 1) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(one / Convert.ToDouble(s4)); WriteD.Text = s1 + " + " + "reciproc" + " (" + s4 + ")"; } else if (d == 2) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(one / Convert.ToDouble(s4)); WriteD.Text = s1 + " - " + "reciproc" + " (" + s4 + ")"; } else if (d == 3) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(one / Convert.ToDouble(s4)); WriteD.Text = s1 + " * " + "reciproc" + " (" + s4 + ")"; } else if (d == 4) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(one / Convert.ToDouble(s4)); WriteD.Text = s1 + " / " + "reciproc" + " (" + s4 + ")"; } else { s1 = WriteText.Text; WriteD.Text = " reciproc" + " (" + s1 + ")"; s3 = Convert.ToString(Convert.ToUInt32(one)); WriteText.Text = Convert.ToString(Convert.ToDouble(s3) / Convert.ToDouble(s1)); } } }
private void Button1_Click(object sender, RoutedEventArgs e) { if (WriteText.Text == "0") { ZeroWT = true; } if (ZeroWT == true || EqCount == true) { WriteText.Clear(); WriteText.Text += "1"; ZeroWT = false; EqCount = false; } else { WriteText.Text += "1"; } }
private void Per_Cent_Click(object sender, RoutedEventArgs e) { string s4; double hangred = 100; if (WriteText.Text == "") { string Error = null; WriteText.Text = (Error); } else { if (d == 1) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); WriteD.Text = s1 + " + " + Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); } else if (d == 2) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); WriteD.Text = s1 + " - " + Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); } else if (d == 3) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); WriteD.Text = s1 + " * " + Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); } else if (d == 4) { s4 = WriteText.Text; WriteText.Clear(); WriteText.Text = Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); WriteD.Text = s1 + " / " + Convert.ToString(Convert.ToDouble(s1) * Convert.ToDouble(s4) / hangred); } } }
private void AddButton_Click(object sender, RoutedEventArgs e) { ShowText.Items.Add(WriteText.Text); WriteText.Clear(); }