Kogmedia Posted May 1, 2007 Posted May 1, 2007 (edited) Hello, I am trying to delete checked items in the listview, however when I delete a item the index changed stopping it from deleting the rest of the item I have checked my code and it is finding the correct checkbox, but when it deletes one the script messes up? and will skip 1 ie. if i check 4 boxes it will delete 2 for $i = 0 to _GUICtrlListViewGetItemCount($listbox)-1 $checked = _GUICtrlListViewGetCheckedState ( $listbox, $i ) If $checked = 1 Then _GUICtrlListViewDeleteItem ( $listbox, $i ) next Edited May 1, 2007 by Kogmedia [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search
Kogmedia Posted May 1, 2007 Author Posted May 1, 2007 (edited) I found a work around allowed multiplesel then highlight and delete the items. $listbox = GUICtrlCreateListView($header,0,0,1024,770,$LBS_MULTIPLESEL) ~~ For $i = 0 to _GUICtrlListViewGetItemCount($listbox)-1 $checked = _GUICtrlListViewGetCheckedState ( $listbox, $i ) If $checked = 1 Then _GUICtrlListViewSetItemSelState ($listbox,$i,1) EndIf Next _GUICtrlListViewDeleteItemsSelected ($listbox) Edited May 1, 2007 by Kogmedia [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search
GaryFrost Posted May 1, 2007 Posted May 1, 2007 for $i = _GUICtrlListViewGetItemCount($listbox)-1 to 0 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now