Jump to content
Sign in to follow this  
num1g8rfan

Removing some, not all items selected in a listview

Recommended Posts

num1g8rfan

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))

Share this post


Link to post
Share on other sites
num1g8rfan

Never mind. Solved the problem utilizing _GUICtrolListView_SetItemSelected. Whew! That was a close one!

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.