Professional Documents
Culture Documents
Object : Form
Caption = "CALCULATOR"
Name = “frmCalc”
Object :CommandButton
Name = cmdNeg
Caption = "+/-"
Object :CommandButton
Name = cmdEqual
Caption = "="
Object :CommandButton
Name = cmdInvert
Caption = "1/X"
Object :CommandButton
Name = cmdExp
Caption = "^"
Object :CommandButton
Name = cmdDiv
Caption = "/"
Object :CommandButton
Name = cmdMul
Caption = "*"
Object :CommandButton
Name = cmdMinus
Caption = "-"
Object :CommandButton
Name = cmdPlus
Caption = "+"
Object :CommandButton
Name = cmdClear
Caption = "C"
Object :CommandButton
Name = cmdDot
Caption = "."
Object :CommandButton
Name = cmdDigit
Caption = "0"
Index = 9
Object :CommandButton
Name = cmdDigit
Caption = "1"
Index = 8
Object :CommandButton
Name = cmdDigit
Caption = "2"
Index = 7
Object :CommandButton
Name = cmdDigit
Caption = "3"
Index = 6
Object :CommandButton
Name = cmdDigit
Caption = "4"
Index = 5
Object :CommandButton
Name = cmdDigit
Caption = "5"
Index = 4
Object :CommandButton
Name = cmdDigit
Caption = "6"
Index = 3
Object :CommandButton
Name = cmdDigit
Caption = "7"
Height = 495
Index = 2
Object :CommandButton
Name = cmdDigit
Caption = "8"
Index = 1
Object :CommandButton
Name = cmdDigit
Caption = "9"
Index = 0
Object :CommandButton
Name = lblDisplay
Alignment = 1 'Right Justify
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Case "+"
lblDisplay.Caption = Op1 + Op2
Case "-"
lblDisplay.Caption = Op1 - Op2
Case "*"
lblDisplay.Caption = Op1 * Op2
Case "/"
If Op2 <> 0 Then
lblDisplay.Caption = Op1 / Op2
Else
lblDisplay.Caption = "E"
End If
Case "^"
lblDisplay.Caption = Op1 ^ Op2
End Select
End Sub
End Sub