Custom Search

Tuesday, March 19, 2013

Programs in VB



Programs in VB


Dim a, b, c As Double
Dim d As String
Private Sub Command1_Click(Index As Integer)
Text1.Text = Text1.Text & Index
a = Val(Text1.Text)
End Sub

Private Sub Command2_Click()
Select Case d
Case "+"
c = b + a
Text1.Text = Str(c)
a = c
Case "-"
c = b - a
Text1.Text = Str(c)
a = c
Case "*"
c = b * a
Text1.Text = Str(c)
a = c
Case "/"
c = b / a
Text1.Text = Str(c)
a = c
End Select
End Sub

Private Sub Command3_Click()
Text1.Text = ""
b = a
a = 0
d = "+"
End Sub

Private Sub Command4_Click()
Text1.Text = ""
b = a
a = 0
d = "-"
End Sub

Private Sub Command5_Click()
Text1.Text = ""
b = a
a = 0
d = "*"
End Sub

Private Sub Command6_Click()
Text1.Text = ""
b = a
a = 0
d = "/"
End Sub

Private Sub Command8_Click()
End
End Sub

No comments:

Post a Comment