quick_sliver007 Posted April 2, 2005 Share Posted April 2, 2005 How do I delete an item from a ListView. Is there like a guictrldeletelistviewitem function. I just want to delete one item from GUICtrlCreateListView not the whole list during run time. . Link to comment Share on other sites More sharing options...
zcoacoaz Posted April 3, 2005 Share Posted April 3, 2005 GuiCtrlDelete ( $ListViewItem ) [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
bshoenhair Posted April 3, 2005 Share Posted April 3, 2005 Might find this post interestinghttp://www.autoitscript.com/forum/index.ph...wtopic=7026&hl= Link to comment Share on other sites More sharing options...
quick_sliver007 Posted April 3, 2005 Author Share Posted April 3, 2005 GuiCtrlDelete ( $ListViewItem )<{POST_SNAPBACK}>I thoughts so too at first but I was wrong. Bshoenhair, pointed me in the right direction. I thank you both very much. . Link to comment Share on other sites More sharing options...
pizzaking Posted April 15, 2005 Share Posted April 15, 2005 Hi!I also have some problems deleting a selected ListViewItem. First I tried this:GUICtrlDelete(GUICtrlRead($MyListView_Handler))$MyListView_Handler is the handler of the ListViewControlGUICtrlRead( ) should return the handler of selected ListViewItemGUICtrlDelete( ) should delete the ItemIt didn't work :-(I already tried the tip from:http://www.autoitscript.com/forum/index.ph...wtopic=7026&hl=my resulting code:$LVM_DELETEITEM = 0x1008 $i = ControlListView ( "", "", $MyListView_Handler, "GetSelected" ) GuiCtrlSendMsg($MyListView_Handler, $LVM_DELETEITEM,$i,0)This didn't work either, the selected ListViewItems where still there.Do I have to 'update' (eg GUICtrlSetData) the ListView?Can anyone help?Thanks Link to comment Share on other sites More sharing options...
bshoenhair Posted April 15, 2005 Share Posted April 15, 2005 Hi!I also have some problems deleting a selected ListViewItem. First I tried this:GUICtrlDelete(GUICtrlRead($MyListView_Handler))$LVM_DELETEITEM = 0x1008$i = ControlListView ( "", "", $MyListView_Handler, "GetSelected" )<{POST_SNAPBACK}>You are looking for a listview in a gui with a blank title ?$i = ControlListView ( "WinTitleGoesHere", "WinTextGoesHere", $MyListView_Handler, "GetSelected" ) Link to comment Share on other sites More sharing options...
pizzaking Posted April 16, 2005 Share Posted April 16, 2005 Thanks for your reply, but ControlListView accesses the correct ListView and returns a correct value $i (starting with "0" if the first item was selected), @error is "0" too. GuiCtrlSendMsg returned always "0" and no @error. But finally I found the reason of the trouble: Unfortunately $i was a String, so I had to convert the return using Number() before GuiCtrlSendMsg was able to work with it $i = Number(ControlListView ( "", "", $MyListView_Handler, "GetSelected" )) GuiCtrlSendMsg($MyListView_Handler, $LVM_DELETEITEM,$i,0) It's so easy... ;-) 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