Monday 7 October 2013

Using airthmatic operators

Design Form

  1. Select four option button for airthmatic operators
  2. Two Command Button first for calculate and second for Exit.
  3.  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

No comments:

Post a Comment