リスト8:[=]キーがクリックされたときの処理


Private Sub cmdEqual_Click()
  sglNumber2 = Val(txtNumber.Text)
  Select Case intOperator
    Case 0: sglAnswer = sglNumber1 + sglNumber2
    Case 1: sglAnswer = sglNumber1 - sglNumber2
    Case 2: sglAnswer = sglNumber1 * sglNumber2
    Case 3: sglAnswer = sglNumber1 / sglNumber2
  End Select
  sglResult = sglAnswer
  txtNumber.Text = CStr(sglAnswer)
End Sub


本文へ戻る