0% found this document useful (0 votes)
270 views

Vb. Record Lab 2021

The document describes a program that allows users to calculate the cost of capital using different finance functions. The program contains checkboxes to select between calculating the cost of debt, cost of equity, cost of preference, and uses corresponding labels and textboxes. Calculations are performed by dividing relevant values when the calculate button is clicked. The aim is to design a form to compute cost of capital using visual basic's finance functions and checkbox controls.

Uploaded by

AKILAMATHI A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views

Vb. Record Lab 2021

The document describes a program that allows users to calculate the cost of capital using different finance functions. The program contains checkboxes to select between calculating the cost of debt, cost of equity, cost of preference, and uses corresponding labels and textboxes. Calculations are performed by dividing relevant values when the calculate button is clicked. The aim is to design a form to compute cost of capital using visual basic's finance functions and checkbox controls.

Uploaded by

AKILAMATHI A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 100

TEXT FORMATTING AND ALIGNMENT

EX NO.1 DATE:
AIM:

To design a form with text box to perform the alignment and format
function.

ALGORITHM:

Step 01: Open a visual basic application with windows form.


Step 02: Create a text box control and button and radio option in the fallowing
design.
Step 03: Format the text with italic, bold and normal text.
Step 04: Make the alignment changes also by applying the alignment. Step
05: Display the output and save the program.

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

Private Sub Command1_Click()


Text4.Alignment = 0
End Sub
Private Sub Command2_Click()
Text4.Alignment = 1
End Sub

Private Sub Command3_Click()


Text4.Alignment = 2
End Sub

Private Sub Command4_Click()


Text4.FontName = Text1.Text If
Text2.Text = "bold" Then
Text4.FontBold = True
ElseIf Text2.Text = "italic" Then
Text4.FontItalic = True
ElseIf Text2.Text = "regular" Then

1
Text4.FontBold = False
Text4.FontItalic = False

1
End If
End Sub

Private Sub Command5_Click()


End
End Sub

Private Sub Form_Load()


Me.WindowState = 2
For I = 0 To Screen.FontCount
List1.AddItem Screen.Fonts(I)
Next I
For I = 9 To 30
List3.AddItem I
I=I+1
Next I
List2.AddItem "regular"
List2.AddItem "bold"
List2.AddItem "italic"
End Sub

Private Sub List1_Click()


Text1.Text = List1.Text
End Sub

1
Private Sub List2_Click()
Text2.Text = List2.Text

1
End Sub

Private Sub List3_Click()


Text3.Text = List3.Text
End Sub
OUTPUT:

1
RESULT:

Thus the given program has been executed successfully.

1
LIST OF PRODUCT
EX NO.2 DATE:
AIM:

To design a form to display the list of products by declaring array function.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs  Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the object windows(form) with text box and check boxes and
option button and command box
Step 05: Use two command buttons namely calculate and end.
Step 06: In the coding window use the appropriate control for making the text
label, option and command button.
Step 07: Also move the text to add number and calculate the value by
appropriate control.
Step 08: End the command box using the end option.
Step 09: Run and execute and close the process.
CODING :
Private Sub Command1_Click()
List1.AddItem (Text1.Text)
Text1.Text = ""
MsgBox "itemadded", vbInformation End

2
Sub

3
Private Sub Command2_Click()
List1.remveitem (List1.ListIndex)
MsgBox "itemremoved", vbCritical
End Sub

Private Sub Command3_Click()


End
End Sub
OUTPUT:

4
RESULT:

Thus the given program has been executed successfully.

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:

Step 01: Start the process


Step 02: Click Start All Programs  Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the object windows(form) with text box and check boxes and
option button and command box
Step 05: Use two command buttons namely calculate and end.
Step 06: In the coding window use the appropriate control for making the text
label, option and command button.
Step 07: Also move the text to add number and calculate the value by
appropriate control.
Step 08: End the command box using the end option.
Step 09: Run and execute and close the process.

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

Private Sub Command2_Click()


End
End Sub

Private Sub Option1_Click()


Label2.Caption = "Initial investment"
Label3.Caption = "Annual cashflow"
Label4.Caption = "payback period"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

Private Sub Option2_Click()


Label2.Caption = "Original investment"
Label3.Caption = "Annual cashflow"
Label4.Caption = "Discount cashflow method"
Text1.Text = ""
Text2.Text = ""
8
Text3.Text = ""
Text1.SetFocus

9
End Sub

Private Sub Option3_Click()


Label2.Caption = "Annual average net cashflow"
Label3.Caption = "Original investment"
Label4.Caption = "Average raye of return"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End Sub

1
OUTPUT:

1
RESULT:

Thus the given program has been executed successfully.

1
ADVERTISEMENT BANNER
EX NO.4 DATE:
AIM:

To design a form to display an advertisement banner using image box


control with string function.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All ProgramsMicrosoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the object windows(form) with text box and check boxes and
option button and command box
Step 05: Use two command buttons namely calculate and end.
Step 06: In the coding window use the appropriate control for making the text
label, option and command button.
Step 07: Also move the text to add number and calculate the value by
appropriate control.
Step 08: End the command box using the end option.
Step 09: Run and execute and close the process.

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

Private Sub Command2_Click()


List2.AddItem ("m.com")
List2.AddItem ("m.sc")
List2.AddItem ("m.c.a")
List2.AddItem ("m.a")
End Sub

Private Sub Command3_Click()


List3.AddItem ("m.phil(commerce)")
List3.AddItem ("m.phil(computer science)")
End Sub
Private Sub Command4_Click()
End
End Sub

1
4. ADVERTISEMENT BANNER

1
OUTPUT:

RESULT:

Thus the given program has been executed successfully.

1
COST OF CAPITAL
EX NO.5 DATE:
AIM:

To design a dorm to compute cost of capital using finance function in visual


basic using check box.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the object windows(form) with text boxes and the command
box ( calculate, clear, end)
Step 05: In the coding window use the appropriate control for making the form and
control button.
Step 06: Run and execute the program.

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

Private Sub Check2_Click()


If Check2.Value = 1 Then
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Label2.Caption = "interest"
Label3.Caption = "prinicipal amount"
Label3.Enabled = False Text2.Visible
= False
Label4.Caption = "cost of debt(before tax)"
End If
End Sub

Private Sub Check3_Click()


If Check3.Value = 1 Then
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
2
Label1.Caption = "divident"
Label2.Caption = "net amount"

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

Private Sub Command1_Click()

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:

Thus the given program has been executed successfully.

2
WORKING CAPITAL
EX NO.6 DATE:
AIM:

To design form to perform working capital analysis by declaring finance


function using flex grid control

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace required control on a form such as labels, command button Ms
flex grid.
Step 05: Write a code to perform display working capital analysis by declaring
finance function using flex grid control.
Step 06: Run the program by clicking the run button.
Step 07: Stop the program.

CODING:

Private Sub Command1_Click()


Text5.Text = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) +
Val(Text4.Text)
End Sub

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

Private Sub Command3_Click()


Text12.Text = Val(Text5.Text) + Val(Text11.Text)
End Sub

Private Sub Command4_Click()


End
End Sub

3
6. WORKING CAPITAL

3
6. WORKING

CAPITAL

OUTPUT:

RESULT:

Thus the given program has been executed successfully.

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:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace required control on a form such as labels, command button Ms
chart.
Step 05: Write a code to perform display break even analysis using line and
chart controls, by declaring variables.
Step 06: Run the program by clicking the run button.
Step 07: Stop the program.

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

Private Sub Command2_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
End Sub

3
Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()


With Combo1
.AddItem "3d bar"
.AddItem "2dbar"
.AddItem "3d line"
.AddItem "2d line"
.AddItem "3d area"
.AddItem "2d area"
.AddItem "3d step"
.AddItem "2d step"
.AddItem "3d combination"
.AddItem "2d combination"
End With
Dim x(1 To 7, 1 To 6) As Variant
x(1, 2) = "fixed cost"
x(1, 3) = "unit selling price"
x(1, 4) = "variable cost"
x(1, 5) = "break event point"
x(2, 1) = "fixed cost"
x(2, 2) = Val(Text1.Text)
x(2, 3) = Val(Text1.Text)

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:

Thus the given program has been executed successfully.

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:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the object window (form) with text box, rich text box and
command box.
Step 05: Name the command box as add and end.
Step 06: Click and command to add the values Step
07: Click and command to exit the program. Step
08: Save the program.
Step 09: Run and execute the program.

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

Private Sub Command2_Click()


End
End Sub

Private Sub Form_Load()


Dim a(4) As String
s1 = Space(5)
a(0) = "s.no"
a(1) = "purchase"
a(2) = "sales"
a(3) = "profit/loss"
RichTextBox = a(0) + s1 + a(1) + s1 + a(2) + s1 + a(3)
End Sub

4
8. RICH TEXT BOX

4
OUTPUT:

RESULT:

Thus the given program has been executed successfully.

4
PRODUCT LIFE CYCLE
EX NO.9 DATE:

AIM:

To design a form to display product life cycle using slider control.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the form with the images using the tools boxes and with label
and horizontal scroll box (if scroll) and two images boxes.
Step 05: Browse the image or take the image from the library. Step

06: Give the coding and run the program.


Step 07: Stop the process.

CODING:

Private Sub Slider1_Click()

If Slider1.Value = 0 Then

MsgBox "THE PRODUCT IS INTRODUCTION STAGE"

ElseIf Slider1.Value = 1 Then

MsgBox "THE PRODUCT IS GROWTH STAGE"


4
ElseIf Slider1.Value = 2 Then

4
MsgBox "THE PRODUCT IS MATURITY STAGE"

ElseIf Slider1.Value = 3 Then

MsgBox "THE PRODUCT IS SATURATION STAGE"

ElseIf Slider1.Value = 4 Then

MsgBox "THE PRODUCT ISDECLINE STAGE"

End If

End Sub

9. PRODUCT LIFE CYCLE

4
OUTPUT:

RESULT:

Thus the given program has been executed successfully.

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:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace a request control on a label text and command button in
form.
Step 05: Create a database using SQL and add control.
Step 06: Write a code window for executing for an organization.
Step 07: Run the program.
Step 08: Stop the process.

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

Private Sub Command3_Click()


Adodc1.Recordset .Delete
MsgBox "RECORD DELETED"
End Sub

Private Sub Command4_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub

Private Sub Command5_Click()


End
End Sub

5
10. PAY SLIP

5
10. PAY SLIP
OUTPUT:

RESULT:

Thus the given program has been executed successfully.

5
ANIMATION
EX NO.11 DATE:
AIM:

To design the form to display the highlights of the budget using option
button and animation.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace a request control on a label text and command button in
form.
Step 05: Write a code to perform form display the highlights of budget using
option button and animation.
Step 06: Run the program.
Step 07: Stop the process.

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:

Thus the given program has been executed successfully.

5
SUPER MARKET BILL
EX NO.12 DATE:
AIM:

To design a supermarket bill to display the sales invoice, and create a


database using data control, option button, check box, data picker, etc.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace a request control on a label text and command button, text box.
Step 05: Write a code to perform form display the highlights of budget using
option button and animation.
Step 06: Run the program.
Step 07: Stop the process.

CODING:

Private Sub Check1_Click()


If Text5.Text > 1000 Then
Text8.Text = Val(Text5.Text) * 10 / 100
End If
End Sub

6
Private Sub Check2_Click()
Text5.Text = Val(Text3.Text) * Val(Text4.Text)
End Sub

Private Sub Check3_Click()


Text7.Text = Val(Text5.Text) - Val(Text6.Text)
End Sub

Private Sub Command1_Click()


Adodc1.Recordset.AddNew
MsgBox "RECORD ADDED"
End Sub

Private Sub Command2_Click()


Adodc1.Recordset.Delete
MsgBox "RECORD DELETED"
End Sub

Private Sub Command3_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
6
Text7.Text = ""
Text8.Text = ""

6
End Sub

Private Sub Command4_Click()


End
End Sub

Private Sub Command5_Click()


Adodc1.Recordset.Update
MsgBox "RECORD UPDATED"
End Sub

12.SUPER MARKET

BILL

6
6
12. SUPER MARKET
BILL OUTPUT:

RESULT:

Thus the given program has been executed successfully.

6
BANK CUSTOMER
EX NO.13 DATE:

AIM:

To design the form to create a bank customer database by declaring simple


array and multiple arrays using data control.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace a request control on a label text and command button, text
box.
Step 05: Write a code to perform form display the highlights of budget using option
button and animation.
Step 06: Run the program.
Step 07: Stop the process.

CODING:

Private Sub Command1_Click()


Text12.Text = Val(Text5.Text) * Val(Text6.Text)
6
End Sub

6
Private Sub Command2_Click()
Text13.Text = Val(Text11.Text) + Val(Text12.Text) - Val(Text7.Text) *
Val(Text8.Text)
End Sub

Private Sub Command3_Click()


Text14.Text = Val(Text12.Text) - Val(Text9.Text) * Val(Text10.Text)
End Sub

Private Sub Command4_Click()


Text15.Text = Sqr(2 * Val(Text1.Text) * Val(Text2.Text) / Val(Text3.Text) *
Val(Text14.Text))
End Sub

Private Sub Command5_Click()


End
End Sub

Private Sub Form_Load()


Text1.Text = "" Text2.Text
= ""
Text3Text = ""
Text4.Text = ""
Text5.Text = ""
6
Text6.Text = ""
Text7.Text = ""

6
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
End Sub
13. BANK CUSTOMER

7
OUTPUT

RESULT:

Thus the given program has been executed successfully.

7
INVENTORY CONTROL
EX NO.14 DATE:

AIM:

To design a form to calculate minimum, maximum, reorder, reorder quantity,


EOQ and display the inventory control records using data object.

ALGORITHM:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: To replace a request control on a label text and command button, in the
form..
Step 05: Write a code to perform form display inventory control in the windows
for executing for an organization.
Step 06: Run the program.
Step 07: Stop the process.

7
CODING:

Private Sub Command1_Click()

Text12.Text = Val(Text5.Text) * Val(Text6.Text)

End Sub

Private Sub Command2_Click()

Text13.Text = Val(Text11.Text) + Val(Text12.Text) - Val(Text7.Text) *


Val(Text8.Text)

End Sub

Private Sub Command3_Click()

Text14.Text = Val(Text12.Text) - Val(Text9.Text) * Val(Text10.Text)

End Sub

Private Sub Command4_Click()

Text15.Text = Sqr(2 * Val(Text1.Text) * Val(Text2.Text) / Val(Text3.Text) *


Val(Text14.Text))

End Sub

7
Private Sub Command5_Click()

7
End

End Sub

Private Sub Form_Load()

Text1.Text = ""

Text2.Text = "" Text3Text

= "" Text4.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:

Step 01: Start the process


Step 02: Click Start  All Programs Microsoft Visual Basic 6.0
Step 03: Click standard EXE and click open.
Step 04: Design the object window use the appropriate control for typing the
coding.
Step 05: In the coding window use the appropriate control for typing the coding.
Step 06: Stop the process.

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:

Thus the given program has been executed successfully.

8
8
8

8
8
9
9
9
9

You might also like