Results 1 to 4 of 4

Thread: Working with Array

Threaded View

  1. #1

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Working with Array

    Hi every one , this is base function about array. i collected on this

    How to VB.NET ArrayList

    Code:
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, 
    	ByVal e As System.EventArgs) Handles Button1.Click
            Dim i As Integer
            Dim ItemList As New ArrayList()
            ItemList.Add("Item4")
            ItemList.Add("Item5")
            ItemList.Add("Item2")
            ItemList.Add("Item1")
            ItemList.Add("Item3")
            MsgBox("Shows Added Items")
            For i = 0 To ItemList.Count - 1
                MsgBox(ItemList.Item(i))
            Next
            'insert an item
            ItemList.Insert(3, "Item6")
            'sort itemms in an arraylist
            ItemList.Sort()
            'remove an item
            ItemList.Remove("Item1")
            'remove item from a specified index
            ItemList.RemoveAt(3)
            MsgBox("Shows final Items the ArrayList")
            For i = 0 To ItemList.Count - 1
                MsgBox(ItemList.Item(i))
            Next
        End Sub
    End Class
    Last edited by manhit45; Jun 15th, 2009 at 01:34 AM.
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width