Jump to content

_GUICtrlListViewDeleteAllItems doesnt work anymore


Recommended Posts

Hi all,

I've just updated my autoit installtion to the latest production release, BUT I discovered that this function: _GUICtrlListViewDeleteAllItems isnt a function anymore, they have changed it to _GUICtrlListView_DeleteAllItems . I've changed the function names to the new one, but now it gives me the following error:

Use GUICtrlDelete to delete items

Or if items were created with UDF functions MAKE sure to pass in handle to control NOT the controlid

Whats wrong, the code I used is the following:

_GUICtrlListView_DeleteAllItems($ListView0) ; Listview0, is the listview

Link to comment
Share on other sites

Hi all,

I've just updated my autoit installtion to the latest production release, BUT I discovered that this function: _GUICtrlListViewDeleteAllItems isnt a function anymore, they have changed it to _GUICtrlListView_DeleteAllItems . I've changed the function names to the new one, but now it gives me the following error:

Whats wrong, the code I used is the following:

_GUICtrlListView_DeleteAllItems($ListView0) ; Listview0, is the listview

if you created the listview items using the built-in function then you need to use GuiCtrlDelete to delete the items

if you created the items using the UDF functions then you need to get the handle to the control and pass that in.

If you get the handle to the control and pass that in when the items were created using the built-in functions your on your own, this may have adverse affects.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

replace $ListView0 by GUICtrlGetHandle($ListView0) and its work.

So : _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView0))

As I said under certain circumstances this will be a use at your own risk call.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

As I said under certain circumstances this will be a use at your own risk call.

Why is that? What are the possible conflicts?

:)

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

  • 7 months later...

When one deletes a ListView Control, are all the items deleted, too?

I ask this since in my situation it is a bit frustrating to write the code to delete one item at a time, so I am experimenting the following alternative:

1) first, I create ListView $bl in window $mainwindow:

$bl = GUICtrlCreateListView("name|city",10,10,200,195)

2) then when I have to delete all the listview items, I do:

GUIctrldelete($bl)
guisetstate(@SW_ENABLE,$mainwindow)
$bl = GUICtrlCreateListView("name|city",10,10,200,195)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...