AB form1 Multiplication textBox1 12 textBox2 34 textBox3 408 (readonly) textBox4-8 TextAlign (right) label1-2 _____ button1 Calculate textBox4, …, textBox8 by Szeto CY Visual C# 2008
雙按 (button1),並加入以下程式碼: 文字轉數字 private void button1_Click(object sender, EventArgs e) { int a, b, c; textBox4.Text = textBox1.Text; textBox5.Text = textBox2.Text; a = int.Parse(textBox1.Text); b = int.Parse(textBox2.Text); c = a * b; textBox3.Text = c.ToString(); textBox8.Text = textBox3.Text; c = a * (b/10)*10; textBox6.Text = c.ToString(); c = a * (b%10); textBox7.Text = c.ToString(); } 數字轉文字 by Szeto CY Visual C# 2008