Saturday, 20 August 2011

Arithmatic Operation (VB)

Dim a, b, c As Integer
Private Sub Command1_Click()
a = Text1.Text
b = Text2.Text
c = Val(a) + Val(b)
Label2.Caption = c
End Sub

Private Sub Command2_Click()
a = Text1.Text
b = Text2.Text
c = a - b
Label2.Caption = c
End Sub

Private Sub Command3_Click()
a = Text1.Text
b = Text2.Text
c = a * b
Label2.Caption = c
End Sub

Private Sub Command4_Click()
a = Text1.Text
b = Text2.Text
c = a / b
Label2.Caption = c
End Sub

Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Label2.Caption = ""
End Sub

Private Sub Command6_Click()
End
End Sub

0 comments:

Post a Comment