20 likes | 101 Views
A B. textBox1, …, textBox3. textBox4, …, textBox8. 雙按 (button1) ,並加入以下程式碼:. 文字轉數字. private void button1_Click (object sender, EventArgs e) { int a, b, c; textBox4.Text = textBox1.Text; textBox5.Text = textBox2.Text;
E N D
AB textBox1, …, textBox3 textBox4, …, textBox8 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(); } 數字轉文字 Visual C# 2008