✔ 最佳答案
最basic果d只係需要4個運算的?
1. 2個textboxes+6個buttons+1個label
2. button: +,-,*,/,reset,enter
3. label: show ans
4. textbox: input values
把textbox1的數+/-/*//textbox2的數就得
即Val(textbox1.text)+Val(textbox2.text)
禁enter制
之後用label show
2009-04-12 11:52:21 補充:
dim 2個double variable(tempans1 & tempans2) 同1個string variable(sign)
1. 1個textbox + 9個button(no. 1-9) + 4個button(+,-,*,/)+reset+equals
2. 入0的code: txtDisplay.Text = txtDisplay.Text & btnZero.Text
2009-04-12 11:52:25 補充:
3. 入+的code: tempans1 = txtDisplay.Text
txtDisplay.Clear()
sign = "+"
2009-04-12 11:53:08 補充:
4.=的code
If sign = "+" Then
tempans2 = tempans1 + Val(txtDisplay.Text)
ElseIf sign = "-" Then
tempans2 = tempans1 - Val(txtDisplay.Text)
2009-04-12 11:53:34 補充:
ElseIf sign = "*" Then
tempans2 = tempans1 * Val(txtDisplay.Text)
ElseIf sign = "/" Then
tempans2 = tempans1 / Val(txtDisplay.Text)
End If
txtDisplay.Text = tempans2
2009-04-12 11:55:24 補充:
5. reset就係clear全部ge野
6. +的code=-,*,/的code(改sign),1-9的code同0的code(改button name)
就係咁多!!!!