mattw112 Posted June 25, 2010 Share Posted June 25, 2010 Just trying to clear a list box... and not working... My list creation is: $List_Values_Show = GUICtrlCreateListView("PC Name|Registry Flag", 16, 16, 477, 447) I have a button that is tied to the following: have tried: _GUICtrlListBox_ResetContent($List_Values_Show) Also tried: GUICtrlSetData($List_Values_Show, "") Also tried: _GUICtrlListBox_BeginUpdate(GUICtrlGetHandle($List_Values_Show)) _GUICtrlListBox_ResetContent(GUICtrlGetHandle($List_Values_Show)) _GUICtrlListBox_EndUpdate(GUICtrlGetHandle($List_Values_Show)) The list box works, but the problem is I can't clear it when the button is pressed... Thanks, Terry Link to comment Share on other sites More sharing options...
GEOSoft Posted June 25, 2010 Share Posted June 25, 2010 I guess it won't. You can't use Listbox functions on a listview control. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
mattw112 Posted June 25, 2010 Author Share Posted June 25, 2010 I guess it won't. You can't use Listbox functions on a listview control.Makes sense, then how do you clear a list box?Terry Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 25, 2010 Share Posted June 25, 2010 (edited) Makes sense, then how do you clear a list box?Still confused? Are you working with a list box, or a list view?How about start by reading the help file? Hint: GuiCtrlDelete() is mentioned in the help file under GuiCtrlCreateListViewItem() You might be able to use _GUICtrlListView_DeleteAllItems(), but using the UDF functions on native AutoIt controls can have unpredictable effects. You should generally use UDF functions on controls you created with that UDF, i.e. _GuiCtrlListView_Create(). Edited June 25, 2010 by PsaltyDS 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 Link to comment Share on other sites More sharing options...
GEOSoft Posted June 26, 2010 Share Posted June 26, 2010 From the code posted you are using a listview control (multi-column) so you will need to be using the GuiListView.au3 UDF and NOT the GuiList.au3 UDF. The function you are looking for is probably _GUICtrlListView_DeleteAllItems() George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
mattw112 Posted June 28, 2010 Author Share Posted June 28, 2010 How about start by reading the help file? Hint: GuiCtrlDelete() is mentioned in the help file under GuiCtrlCreateListViewItem() You might be able to use _GUICtrlListView_DeleteAllItems(), but using the UDF functions on native AutoIt controls can have unpredictable effects. You should generally use UDF functions on controls you created with that UDF, i.e. _GuiCtrlListView_Create().hi,So I did get it working last week by just deleting the control and then recreating it every time I wanted a clear, found by reading the help guide...Not sure if that's the best way though so today I tried the _GUICtrlListView_DeleteAllItems() you suggested with the _GUICtrlListView_Create and didn't seem to work for me. Then I decided to go back and leave the GUICtrlCreateListView() and try the _GUICtrlListView_DeleteAllItems() with that and it worked! So for me at least that was the right combination.Thanks,Terry Link to comment Share on other sites More sharing options...
GEOSoft Posted June 28, 2010 Share Posted June 28, 2010 I've had problems with that _GUICtrlListView_Create() in the past so I always create it as a standard control and then use the functions from GuiListView.au3 although technicaly the old bird is correct, you shouldn't mix and match control creation. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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