I am providing an example for ListItemCollection. Remove Method (ListItem) that is used in VB. I am sure that you will get some hint from it. The following exhibit the code illustration creating ListItemCollection objects, toting up items to the collections, and removing items from the anthologies. In the example, the ListItemCollection named listBoxData is bought into play as the data source for a ListBox control ListBox1 Called, and the ListItemCollection Called ddBoxData is used as the data source for a DropDownList control called DropDownList1.
Code:
'Add the selected item to DropDownList1.
DropDownListA.Items.Add (ListBoxA.SelectedItem)
'Delete the selected item from ListBoxA.
ListBoxA.Items.Remove (ListBoxA.SelectedItem)
Bookmarks