num1g8rfan Posted March 13, 2008 Share Posted March 13, 2008 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!CODECase $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 More sharing options...
num1g8rfan Posted March 13, 2008 Author Share Posted March 13, 2008 Never mind. Solved the problem utilizing _GUICtrolListView_SetItemSelected. Whew! That was a close one! Link to comment Share on other sites More sharing options...
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