Reverses the order of the objects in the ArrayList in vb.net
------------------------------------------------------------------------------------------------
Dim MyArray As New ArrayList
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyArray.Add("key")
MyArray.Add("Name")
MyArray.Add("Address")
MyArray.Reverse() 'reverses order of the objects in the ArrayLis
add_to_listbox()
End Sub
Public Sub add_to_listbox() 'function for adding arraylist value to listbox
ListBox1.Items.Clear()
ListBox1.Items.AddRange(MyArray.ToArray)
Me.Text = MyArray.Count.ToString
End Sub
------------------------------------------------------------------------------------------
No comments:
Post a Comment