Jump to content

Removing some, not all items selected in a listview


Recommended Posts

Hello - Sorry to bother, but am racking my brain over what should be an easy situation. I have created a listview and obtained a list of elements that were selected via _GUICtrolListView_GetSelectedIndices. Essentially, I'm calling a function to make sure that the item can be removed from the list. If 'no', then I want to prevent it from getting removed. At one point, I was simply keeping track of the indexes in the listview, but after the first removal within the listview, the index number would be off. Any suggestions would be greatly appreciated. - Thanks!

CODE
Case $msg = $removeView

Local $array1 = _GUICtrlListView_GetSelectedIndices($woListview,1)

Local $removeViewArray[1]

for $i = 1 to $array1[0]

Local $viewName = _GUICtrlListView_GetItemText($woListview, $array1[$i],0)

Local $removed = removeViews($viewName)

if $removed = 'no' Then

; Unselect the item

$ret = _GUICtrlListView_SetItemChecked($woListview,$array1[$i],1)

EndIf

Next

_GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($woListview))

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...