.Net Programming

ArrayList in VB.Net

ArrayList is one of the most flixible data structure from VB.NET Collections. ArrayList contains a simple list of values. Very easily we can add , insert , delete , view etc.. to do with ArrayList. It is very flexible becuse we can add without any size information , that is it grow dynamically and also shrink .

Language : VB.Net

[sourcecode language='vb']
Public Class Dynamic_Arrays
Dim ArrLst As New ArrayList
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
ArrLst.Add(Val(txtNum.Text))
txtNum.Text = “”
End Sub

Private Sub cmdDisp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDisp.Click
For i = 0 To ArrLst.Count – 1
MsgBox(ArrLst.Item(i))
Next
End Sub
End Class
[/sourcecode]



Leave a Comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.


WordPress - Vaibhav Kanwal