Jewtus Posted January 23, 2015 Share Posted January 23, 2015 I have a listview in one of my GUIs and I have a button and box for filtering the results. This is the function I'm using right now: $Index=_GUICtrlListView_FindInText($List,GUICtrlRead($FilterInput)) MsgBox(0,"test",$Index) _GUICtrlListView_DeleteItem($List,$Index) I've tried using the $bWrapOK command in the find, but I don't really understand how it works. Basically, what I'm trying to do is find every occurrence of the input filter and delete anything that DOESN'T contain that value. Tips/Suggestions? Link to comment Share on other sites More sharing options...
mikell Posted January 23, 2015 Share Posted January 23, 2015 Suggestion, loop through the items with _GUICtrlListView_GetItemText, compare each result with the filter using StringInStr or regex, then delete the item if doesn't match Link to comment Share on other sites More sharing options...
Jewtus Posted January 23, 2015 Author Share Posted January 23, 2015 Perfect! Thats what I needed. For anyone who wants the code: Case $Clean For $j=UBound($array) -1 to 0 Step -1 $Cleanval=_GUICtrlListView_GetItemText($List,$j,2) If StringInStr($Cleanval,GUICtrlRead($FilterInput))=0 Then _GUICtrlListView_DeleteItem($List,$j) Next 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