Friday, 8 February 2013

Make a Project Using Dynamic Array in Visual Basic


Dim book() As String
Dim add As Integer
Private Sub Command1_Click()
add = InputBox("Enter Total no of books")
ReDimbook(add) As String
End Sub

Private Sub Command2_Click()
add = add + 1
ReDim Preserve book(add) As String
book(add) = InputBox("Enter New name of Books")
List1.Clear
For i = 0 To add
List1.AddItem book(i)
Next
End Sub

Private Sub Command3_Click()
List1.Clear
For i = 0 To add
book(i) = InputBox("Enter Book Name:")
List1.AddItem book(i)
Next
End Sub

Output:


Enter your email address:

Delivered by FeedBurner