chssoccer Posted January 10, 2008 Posted January 10, 2008 How do I use ControlListView() to accomplish this. I'm trying to make a filter where it searches my listview column for items containing the text "Pot Limit" Any of the items that don't contain this text I want it to hide but I'm having trouble achieving this. How can I do this with ControlListView() Here's what I have but it's not working: $zItems = ControlListView("Buddy List - v1.0", "", 89, "FindItem", "Pot Limit") $zcount = _GUICtrlListViewGetItemCount($sListview); counts the items in my au3 listview $zcount = $zcount - 1 For $t = 0 To $zcount ControlHide("Buddy List - v1.0", "", $t) Next
rasim Posted January 11, 2008 Posted January 11, 2008 Hello! Try this: #include <GuiListView.au3> $title = "RegCleaner 4.3 by Jouni Vuorio" $TextToDel = "[Unknown]" $hListView = ControlGetHandle($title, "", "TListView1") If @error Then MsgBox(16, "Error", "Required window not exist") Exit EndIf $LV_Item = ControlListView($title, "", $hListView, "GetItemCount") While 1 If Not _GUICtrlListView_FindText($hListView, $TextToDel, 0) Then ExitLoop For $i = 0 To $LV_Item If ControlListView($title, "", $hListView, "GetText", $i) = $TextToDel Then _GUICtrlListView_DeleteItem($hListView, $i) Next WEnd Tested on RegCleaner program.
PsaltyDS Posted January 11, 2008 Posted January 11, 2008 Hello! Try this: ; ... While 1 If Not _GUICtrlListView_FindText($hListView, $TextToDel, 0) Then ExitLoop For $i = 0 To $LV_Item If ControlListView($title, "", $hListView, "GetText", $i) = $TextToDel Then _GUICtrlListView_DeleteItem($hListView, $i) Next WEnd Tested on RegCleaner program. Note that deletes vice hides the item. I don't think you can hide individual items, or at least I don't know how. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
rasim Posted January 11, 2008 Posted January 11, 2008 Note that deletes vice hides the item. I don't think you can hide individual items, or at least I don't know how. Hello PsaltyDS! I know, my example delete item. I not found function for hiding ListView item, but i suggest any solution.
Moderators big_daddy Posted January 12, 2008 Moderators Posted January 12, 2008 Note that deletes vice hides the item. I don't think you can hide individual items, or at least I don't know how. I gave an example of this here.
rasim Posted January 12, 2008 Posted January 12, 2008 big_daddy Nice example! I add this in my script collection! Thanks!
Moderators big_daddy Posted January 12, 2008 Moderators Posted January 12, 2008 big_daddy Nice example! I add this in my script collection! Thanks! You're welcome! I need to add this to my snippet database as well.
PsaltyDS Posted January 12, 2008 Posted January 12, 2008 I gave an example of this here.Nicely done! There still doesn't seem to be a hidden state available in the ListView control item properties, but this keeps track of what gets deleted in a Global array, so it can be re-inserted on command, simulating "hide" and "unhide". Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
chssoccer Posted January 19, 2008 Author Posted January 19, 2008 Hello! Try this: #include <GuiListView.au3> $title = "RegCleaner 4.3 by Jouni Vuorio" $TextToDel = "[Unknown]" $hListView = ControlGetHandle($title, "", "TListView1") If @error Then MsgBox(16, "Error", "Required window not exist") Exit EndIf $LV_Item = ControlListView($title, "", $hListView, "GetItemCount") While 1 If Not _GUICtrlListView_FindText($hListView, $TextToDel, 0) Then ExitLoop For $i = 0 To $LV_Item If ControlListView($title, "", $hListView, "GetText", $i) = $TextToDel Then _GUICtrlListView_DeleteItem($hListView, $i) Next WEnd Tested on RegCleaner program. Hi, and thanks for the reply , sorry I'm late but is the line in bold the same as _GUICtrlListViewGetItemText? The reason I'm asking is because I'm using version 3.2.8.1 right now and can't upgrade until I finish this script because it's too big.
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