
AIM : TO MAKE A SIMPLE FORM IN VISUAL BASIC
NAME : JEKIN . J . TRIVEDI
CLASS: SE - IT (B5) ROLL NO : 67
********CODE FOR FORM1*************
Dim a As Integer
Dim b As Integer
Dim c As Integer
Private Sub Command1_Click()
Dim d As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a + b
Text3.Text = c
End Sub
Private Sub Command2_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
d = a - b
Text3.Text = d
End Sub
Private Sub Command3_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a * b
Text3.Text = c
End Sub
Private Sub Command4_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "PLEASE CHECK THE INPUT "
ElseIf Val(Text2.Text) = 0 Then
MsgBox "DIVIDE BY 0 ERROR"
Else
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a / b
Text3.Text = c
End If
End Sub
Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Command6_Click()
Select Case Val(Text1.Text)
Case 1
Text2.Text = "HELLO TO ALL"
Case 2
Text2.Text = "BYE"
End Select
End Sub
Private Sub Command7_Click()
a = 10
b = 0
While b < b =" b" text = "" text = "" text = "">
No comments:
Post a Comment