Professional Documents
Culture Documents
Vbfile A
Vbfile A
ss = Int(sec.Caption)
mm = Int(min.Caption)
hh = Int(hr.Caption)
ss = ss + 1
If ss = 60 Then
ss = 0
mm = mm + 1
End If
If mm = 60 Then
mm = 0
hh = hh + 1
End If
If hh = 24 Then
hh = 0
End If
End Sub
OUTPUT
PROGRAM-2
Design an application that accepts an item name from user and adds it to a listbox .
Listbox.AddItem txtAdd.Text
Else
MsgBox ("you must have something to add to the list box"), , "error"
End If
txtAdd.SetFocus
End Sub
End
End Sub
OUTPUT
PROGRAM-3
End
End Sub
Else
End If
End Sub
OUTPUT
PROGRAM-4
Create an application that offers various food items to select from and a mode of
payment .It then displays the total amount payable.
If chkPizza.Value = 1 Then
End If
If Chkdosa.Value = 1 Then
amount = amount + 40
End If
If chkchow.Value = 1 Then
amount = amount + 50
End If
If Optcash.Value = True Then
Else
End If
End If
End Sub
End
End Sub
OUTPUT
PROGRAM-5
factorial = 1
For x = 1 To num
factorial = factorial * x
Next x
End Sub
OUTPUT
PROGRAM-6
Write a procedure to calculate the Simple Interest and invoke this procedure in another
procedure
End
End Sub
P = InputBox("Enter principal")
R = InputBox("enter rate")
T = InputBox("Enter time")
Call SInterest(P, R, T)
End Sub
Public Sub SInterest(P As Single, R As Single, T As Single)
Dim S As Single
S = P * R * T / 100
End Sub
OUTPUT
PROGRAM-7
Form1.BackColor = vbRed
Form1.BackColor = vbGreen
Else
Form1.BackColor = vbBlue
End If
End Sub
OUTPUT
PROGRAM-8
Design a form to find out total marks,average and result whether student is passed or
failed
Dim totalmarks As Integer
Text4.Text = (Str(totalmarks))
End Sub
average = totalmarks / 3
Text5.Text = (Str(average))
End Sub
Private Sub Command3_Click()
Else
End If
End Sub
OUTPUT
PROGRAM-9
Design a form of different shapes by using timer
If Shape1.Visible Then
Shape2.Visible = True
Shape1.Visible = False
Shape3.Visible = False
Shape3.Visible = True
Shape1.Visible = False
Shape2.Visible = False
Else
Shape1.Visible = True
Shape2.Visible = False
Shape3.Visible = False
End If
End Sub
OUTPUT
PROGRAM -10
-10
Dim a As Integer
Dim b As Integer
Dim c As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
End If
End Sub
OUTPUT
PROGRAM-11
Design a form to check even or odd
num = Val(Text1)
Else
End If
Form1.Cls
End Sub
OUTPUT
PROGRAM-12
roll = Text1.Text
List1.Clear
Case 1
List1.AddItem ("3208")
List1.AddItem ("sarita")
List1.AddItem ("mundsa")
Case 2
List1.AddItem ("3206")
List1.AddItem ("Ritu")
List1.AddItem ("Rohad")
Case 3
List1.AddItem ("3205")
List1.AddItem ("Simran")
List1.AddItem ("sisana")
Case 4
List1.AddItem ("3207")
List1.AddItem ("Bharti")
List1.AddItem ("Rohtak")
Case 5
List1.AddItem ("3203")
List1.AddItem ("Sourabh")
List1.AddItem ("sampla")
Case 6
List1.AddItem ("3209")
List1.AddItem ("Ajay")
List1.AddItem ("rohtak")
End Select
End Sub
OUTPUT
PROGRAM-13
End Sub
End
End Sub
Print "Divisible"
Else
Print "not divisible"
End If
End Sub
OUTPUT