private void button1_Click(object sender, EventArgs e) { int n1 = int.Parse(textBox1.Text); int n2 = int.Parse(textBox2.Text); Dollar dollar1 = new Dollar(n1); Dollar dollar2 = new Dollar(n2); Dollar total = new Dollar(0); total = dollar1 + dollar2; string msg = dollar1.ToString() + "+" + dollar2.ToString(); msg += "=" + total.ToString(); MessageBox.Show(msg,"計算"); }
private void button1_Click(object sender, EventArgs e) { int n1 = int.Parse(textBox1.Text); int n2 = int.Parse(textBox2.Text); Dollar dollar1 = new Dollar(n1); Dollar dollar2 = new Dollar(n2); Dollar total = new Dollar(0); total = dollar1 + dollar2; string msg = dollar1.ToString() + "+" + dollar2.ToString(); msg += "=" + total.ToString(); MessageBox.Show(msg, "計算"); }