How to Add, Remove and Clear Items Form ListView Control
In this sample program I will try to explain you how you can add, remove and clear items form a ListView control using Visual Basic.Net (VB.Net).
ListView control allows you to display item text in a list. For example you are selecting files from a TreeView control using ListView control you can display all your selected files in a list. Using ListViewItem class you can access list of items present in a List. Each item that is added in a list forms a collection named as ListViewItemCollection. Here I will use three of its methods Items.Add, Item.Remove and Items.Clear.
To begin with this application adds four controls on your windows form (dialog box) and that are; Label Control, TextBox Control, ListView Control and finally three Button Controls named as cmdAddItem_Click, cmdRemoveItem_Click and cmdClear_Click. Code for these three events are as follows: