'************************************************************************************* '* Name: CS 100-01 * '* Program: Simple Calculator * '* Date: 4/15/03 * '* Description: This program creates a simple calculator controlled by option * '* buttons. * '************************************************************************************* Option Explicit Private Sub cmdStart_Click() Dim sngOperand1 As Single Dim sngOperand2 As Single sngOperand1 = Val(txtOperand1.Text) sngOperand2 = Val(txtOperand2.Text) If (optCalc(0).Value) Then lblResult.Caption = sngOperand1 + sngOperand2 ElseIf (optCalc(1).Value) Then lblResult.Caption = sngOperand1 - sngOperand2 ElseIf (optCalc(2).Value) Then lblResult.Caption = sngOperand1 * sngOperand2 ElseIf (optCalc(3).Value) Then lblResult.Caption = sngOperand1 / sngOperand2 End If End Sub Private Sub cmdEnd_Click() End End Sub