Search for “ArrayList” in vb.net
===================================================================
Dim MyArray As New ArrayList
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MyArray.Add("key")
MyArray.Add("Name")
MyArray.Add("Address")
MyArray.Reverse()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim search As String = InputBox("Search ArrayList for ...?")
If MyArray.Contains(search) Then
MsgBox("Yes, " + search + " was in the array list.")
Else
MessageBox.Show("No iteam in the array list.")
End If
End Sub
===================================================================
No comments:
Post a Comment