Extracting/Deleting Multiple Items From Listbox - Printable Version +- howtothings.co.uk (https://www.howtothings.co.uk) +-- Forum: Computing (https://www.howtothings.co.uk/forumdisplay.php?fid=4) +--- Forum: Programming Support, Graphic Design and Tutorials (https://www.howtothings.co.uk/forumdisplay.php?fid=14) +--- Thread: Extracting/Deleting Multiple Items From Listbox (/showthread.php?tid=1126) |
Extracting/Deleting Multiple Items From Listbox - Clones - 13-11-2011 Description : We are goin' to create 2 Listboxes, add some items in List1 at design time and then with cmdMove command button we'll copy selected items to list2. Concept : This code checks the whole list(List1) through a for loop and then add the selected items to the other List2 NOTE : Make sure that the multiselect property of listboxes is '1-Simple' Code: Private Sub CmdcopyToList2_Click() Explanation : We are cheking selcount just for learning purposes(i.e, to learn the basic adding procedure). If more then ONE items are selected, the loops checks each list item one by one and then adds the item if IT IS SELECTED. NOTE : Step -1 is only for learning purpose, loop can be runned either way. Code: Private Sub CmdRemove_Click() Explanation : Just as the previous one, this too Removes the selected Items. I Hope this helped. RE: Life - Multimedia Maggazine Themes WP (20 in 1) - Drumm - 13-11-2011 I remember this demo from when I was learning VB. |