Design Form
- Select four option button for airthmatic operators
- Two Command Button first for calculate and second for Exit.
- Two text box for Enter the value.
Code :-
Private Sub Command1_Click()Dim a, b, c As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
If Option1.Value = True Then
c = a + b
ElseIf Option2.Value = True Then
c = a - b
ElseIf Option3.Value = True Then
c = a * b
ElseIf Option4.Value = True Then
c = a / b
Else
MsgBox "please select any option for your result"
End If
Text3.Text = c
End Sub
Private Sub Command2_Click()
Form2.Show
Form1.Hide