Dear esparanto234 I think the question asked by u & code posted by u are not same. In ur code actually u are checking whether textbox entry already exists in the listbox or not, if not then it is added to the listbox. Deletion is no where done in ur code. To delete the unselected items, u need to loop through index=0 to index=Listcount-1 and check if a particular index item is selected or not. If it not selected then delete it (but adjust loop accordingly as now listbox has 1 item less than previous). So through loop u can delete unselected item(s).
Comment