|
-
Apr 28th, 2011, 02:14 AM
#1
Thread Starter
New Member
Delete Selected Arraylist Item
Hi all, I would like to know how do I do the code if I wanna delete a selected item from the array list and not all the items store in the array list? My code is,
vb.net Code:
Dim PageObject As pageItem
PageObject = New pageItem("Page" + pnumber.ToString)
PageObject.itemFile = OpenFileDialog1.FileName
PageObject.videos = New ArrayList
PageObject.podcasts = New ArrayList
PageObject.photos = New ArrayList
PageArray.Add(PageObject)
Thanks!
-
Apr 28th, 2011, 07:40 AM
#2
Hyperactive Member
Re: Delete Selected Arraylist Item
I don't get the Code Snippet but typically to remove an item from an arraylist you would use either:
ArrayList.Remove(Item)
ArrayList.RemoveAt(ItemIndex)
-
Apr 28th, 2011, 08:44 AM
#3
Re: Delete Selected Arraylist Item
ArrayList has been almost entirely replaced by List (of T), and should only be used if you have no alternative. However, you would still just call the Remove or RemoveAt methods, either way.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|