Jump to content
Sign in to follow this  
PcExpert

_GUICtrlListViewDeleteAllItems doesnt work anymore

Recommended Posts

PcExpert

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

Share this post


Link to post
Share on other sites
GaryFrost

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.

 

Share this post


Link to post
Share on other sites
PcExpert

So I cannot use the function I mentioned to delete ALL items?

Share this post


Link to post
Share on other sites
NeuroToxic

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

So : _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ListView0))

Edited by NeuroToxic

Share this post


Link to post
Share on other sites
GaryFrost

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.

 

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
Zomp

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)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.