Vb. Record Lab 2021
Vb. Record Lab 2021
EX NO.1 DATE:
AIM:
To design a form with text box to perform the alignment and format
function.
ALGORITHM:
COADING:
Dim I As Integer
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text4.FontStrikethru = True
Else
Text4.FontStrikethru = False
End If
1
End Sub
1
Private Sub Check2_Click()
If Check2.Value = 1 Then
Text4.FontUnderline = True
Else
Text4.FontUnderline = False
End If
End Sub
1
Text4.FontBold = False
Text4.FontItalic = False
1
End If
End Sub
1
Private Sub List2_Click()
Text2.Text = List2.Text
1
End Sub
1
RESULT:
1
LIST OF PRODUCT
EX NO.2 DATE:
AIM:
ALGORITHM:
2
Sub
3
Private Sub Command2_Click()
List1.remveitem (List1.ListIndex)
MsgBox "itemremoved", vbCritical
End Sub
4
RESULT:
5
CAPITAL BUDGETING
EX NO.3 DATE:
AIM:
To design a form to calculate capital budgeting technique by declaring
finance function and variable declaring using option button (radio/check box).
ALGORITHM:
CODING:
Private Sub Command1_Click()
If Option1.Value = True Then
Text3.Text = Val(Text1.Text) / Val(Text2.Text)
6
ElseIf Option2.Value = True Then
Text3.Text = Val(Text1.Text) / Val(Text2.Text) * 100
7
ElseIf Option3.Value = True Then
Text3.Text = Val(Text1.Text) / Val(Text2.Text) * 200 End
If
End Sub
9
End Sub
1
OUTPUT:
1
RESULT:
1
ADVERTISEMENT BANNER
EX NO.4 DATE:
AIM:
ALGORITHM:
CODING:
Private Sub Command1_Click()
List1.AddItem ("b.com")
1
List1.AddItem ("b.sc")
List1.AddItem ("b.c.a")
1
List1.AddItem ("b.a")
End Sub
1
4. ADVERTISEMENT BANNER
1
OUTPUT:
RESULT:
1
COST OF CAPITAL
EX NO.5 DATE:
AIM:
ALGORITHM:
CODING:
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text1 = ""
Text2 = ""
Text3 = ""
1
Text4 = ""
Label2.Caption = "interest"
1
Label3.Caption = "prinicipal amount"
Label3.Enabled = False Text2.Visible
= False
Label4.Caption = "cost of debt(before tax)"
End If
End Sub
2
Label3.Enabled = False
Label4.Caption = "cost of equity"
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = 1 Then
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Label1.Caption = "divident"
Label2.Caption = "net process"
Label3.Enabled = False
Label4.Caption = "cost of preference"
End If
End Sub
If Check1.Value = 1 Then
Text4.Text = Val(Text1.Text) / Val(Text3.Text)
ElseIf Check2.Value = 1 Then
Text4.Text = Val(Text1.Text) * (1 - (Val(Text3.Text)))
ElseIf Check3.Value = 1 Then
Text4.Text = Val(Text1.Text) / Val(Text3.Text)
ElseIf Check4.Value = 1 Then
Text4.Text = Val(Text1.Text) / Val(Text3.Text) End
2
If
End Sub
2
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Check1 = Clear
Check2 = Clear
Check3 = Clear
Check4 = Clear
End Sub
Private Sub Command3_Click()
End
End Sub
2
5. COST OF CAPITAL
2
OUTPUT:
2
RESULT:
2
WORKING CAPITAL
EX NO.6 DATE:
AIM:
ALGORITHM:
CODING:
2
Private Sub Command2_Click()
2
Text11.Text = Val(Text6.Text) + Val(Text7.Text) + Val(Text8.Text) +
Val(Text9.Text) + Val(Text10.Text) + Val(Text1.Text)
End Sub
3
6. WORKING CAPITAL
3
6. WORKING
CAPITAL
OUTPUT:
RESULT:
3
BREAK EVEN ANALYSIS
EX NO.7 DATE:
AIM:
To design a form to display break even analysis using line and chart controls, by
declaring variables.
ALGORITHM:
CODING:
Private Sub Check1_Click()
If Check1.Value = 1 Then
MSChart1.ShowLegend = True
Check1.Caption = "hide legends"
3
Else
MSChart1.ShowLegend = False
3
Check1.Caption = "hide legends"
End If
End Sub
Private Sub Combo1_Change()
MSChart.chartType = Combo1.ListIndex End
Sub
Private Sub Command1_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
c = Val(Text4.Text)
e = Val(Text5.Text)
d = c / (a - b)
Text4.Text = d
e = d * Val(Text1.Text)
Text5.Text = e
End Sub
3
Private Sub Command3_Click()
End
End Sub
3
x(2, 4) = Val(Text1.Text)
x(2, 5) = Val(Text1.Text)
3
x(3, 1) = "unit selling price"
x(3, 2) = Val(Text2.Text)
x(3, 3) = Val(Text2.Text)
x(3, 4) = Val(Text2.Text)
x(3, 5) = Val(Text2.Text)
x(3, 6) = Val(Text2.Text)
x(4, 1) = "variable cost"
x(4, 2) = Val(Text3.Text)
x(4, 3) = Val(Text3.Text)
x(4, 4) = Val(Text3.Text)
x(4, 5) = Val(Text3.Text)
x(4, 6) = Val(Text3.Text)
x(5, 1) = "berak event point"
x(5, 2) = Val(Text4.Text)
x(5, 3) = Val(Text4.Text)
x(5, 4) = Val(Text4.Text)
x(5, 5) = Val(Text4.Text)
x(5, 6) = Val(Text4.Text)
MSChart1.ChartData = x
MSChart1.chartType = 1
End Sub
3
7. BREAK EVEN ANALYSIS
3
7. BREAK EVEN
ANALYSIS OUTPUT:
RESULT:
4
PRODUCT ARRAY FUNCTION USING RICH TEXT BOX
EX NO.8 DATE:
AIM:
To design a form to present details like purchases, sales, profit, etc by declaring
array function and present the details in a rich text box (RTF).
ALGORITHM:
CODING:
Private Sub Command1_Click()
Dim i As Integer
Dim b(4) As Long
For i = 0 To step1
4
b(0) = InputBox("s.no")
b(1) = InputBox("purchase")
4
b(2) = InputBox("sales")
b(3) = InputBox("profit/loss")
s = Space(10)
profit = b(2) - (b(1))
loss = (b(1) - b(2))
RichTextBox1.Text = RichTextBox1.Text + vbCrLf + Str(b(0)) + s +
Str(b(1)) + s + Str(b(2)) + s + Str(b(3))
Next i
End Sub
4
8. RICH TEXT BOX
4
OUTPUT:
RESULT:
4
PRODUCT LIFE CYCLE
EX NO.9 DATE:
AIM:
ALGORITHM:
CODING:
If Slider1.Value = 0 Then
4
MsgBox "THE PRODUCT IS MATURITY STAGE"
End If
End Sub
4
OUTPUT:
RESULT:
4
PAY SLIP
EX NO.10 DATE:
AIM:
To design a pay slip for an organization and create a data base using SQL and
data control.
ALGORITHM:
CODING:
Private Sub Command1_Click()
Text5.Text = Val(Text3.Text) * 10 / 100
Text6.Text = Val(Text3.Text) * 7 / 100
Text7.Text = Val(Text3.Text) * 5 / 100
5
Text4.Text = Val(Text3.Text) + Val(Text5.Text) + Val(Text6.Text) -
Val(Text7.Text)
5
End Sub
Private Sub Command2_Click()
Adodc1.Recordset .AddNew
MsgBox "RECORD ADDED"
End Sub
5
10. PAY SLIP
5
10. PAY SLIP
OUTPUT:
RESULT:
5
ANIMATION
EX NO.11 DATE:
AIM:
To design the form to display the highlights of the budget using option
button and animation.
ALGORITHM:
CODING:
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
Me.WindowState = 2
5
Timer1.Interval = 10
Timer2.Interval = 5
5
End Sub
Private Sub Timer1_Timer()
Image1.Left = Image1.Left + 35
If Image1.Left >= 11000 Then
Image1.Left = 10
Image1.Left = Image1.Left + 10
End If
End Sub
Private Sub Timer2_Timer()
Image2.Left = Image2.Left + 35
If Image2.Left >= 11000 Then
Image2.Left = 10
Image2.Left = Image2.Left + 10
End If
End Sub
5
11. ANIMATION
5
11. ANIMATION
OUTPUT:
RESULT:
5
SUPER MARKET BILL
EX NO.12 DATE:
AIM:
ALGORITHM:
CODING:
6
Private Sub Check2_Click()
Text5.Text = Val(Text3.Text) * Val(Text4.Text)
End Sub
6
End Sub
12.SUPER MARKET
BILL
6
6
12. SUPER MARKET
BILL OUTPUT:
RESULT:
6
BANK CUSTOMER
EX NO.13 DATE:
AIM:
ALGORITHM:
CODING:
6
Private Sub Command2_Click()
Text13.Text = Val(Text11.Text) + Val(Text12.Text) - Val(Text7.Text) *
Val(Text8.Text)
End Sub
6
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
End Sub
13. BANK CUSTOMER
7
OUTPUT
RESULT:
7
INVENTORY CONTROL
EX NO.14 DATE:
AIM:
ALGORITHM:
7
CODING:
End Sub
End Sub
End Sub
End Sub
7
Private Sub Command5_Click()
7
End
End Sub
Text1.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
End Sub
7
14. INVENTORY CONTROL
7
OUTPUT:
7
TREE VIEW AND LIST VIEW
EX NO.15 DATE:
AIM:
To design the form to display tree view and list of folders and files from a
directory of an organization.
ALGORITHM:
7
CODING:
TREE VIEW
Private Sub Form_Load()
Dim i As Integer
'
For i = 1 To 3
TreeView1.Nodes.Add , , "ROOT" & i, "Root Item " & i
Next
'
' Now add some children
'
For i = 1 To 3
With TreeView1.Nodes
.Add "ROOT1", tvwChild, "ROOT1CHILD" & i, "Child Item " & i
.Add "ROOT2", tvwChild, "ROOT2CHILD" & i, "Child Item " & i
.Add "ROOT3", tvwChild, "ROOT3CHILD" & i, "Child Item " & i
End With
Next
'
' Now Add Some Grand-Children '
For i = 1 To 3
With TreeView1.Nodes
.Add "ROOT1CHILD2", tvwChild, , "Grand Child " & i
.Add "ROOT2CHILD2", tvwChild, , "Grand Child " & i
7
.Add "ROOT3CHILD2", tvwChild, , "Grand Child " & i
8
End With
Next End
Sub
LIST VIEW:
Private Sub Form_Load()
' Set the View
ListView1.View = lvwReport
' Add the columns
With ListView1.ColumnHeaders
.Add , , "Name"
.Add , , "Surname"
.Add , , "Address"
End With
With ListView1.ListItems
' Add the normal text
.Add , , "Fred"
.Add , , "Sarah"
.Add , , "Paul"
End With
With ListView1
' Add a value to the second column to the first item on the li
("Fred")
' (1) = First item on list
.ListItems(1).SubItems(1) = "Crowley"
8
.ListItems(2).SubItems(1) = "Ives"
.ListItems(3).SubItems(1) = "Smith"
8
' Add a value to the third column to the first item on the list ("Fred") '
(1) = First item on list
.ListItems(1).SubItems(2) = "16 Liverpool Lane"
.ListItems(2).SubItems(2) = "102 England Street"
.ListItems(3).SubItems(2) = "1 Baker Street" End
With
End Sub
15.TREE VIEW AND LIST
VIEW
TREE VIEW:
8
OUTPUT:
TREE VIEW
8
LIST VIEW
8
OUTPUT:
LIST VIEW
RESULT:
8
8
8
8
8
9
9
9
9