Tutech Posted August 22, 2006 Share Posted August 22, 2006 Hi Just a simple question. I searched the forum and did not find any awnser Is it possible to delete an item from a list which is created with GuiCtrlCreateList ? I just found the possibility to add items with GuiCtrlSetData . No way to delete an item. I dont want to store the whole list in an array. Thanks Micha Link to comment Share on other sites More sharing options...
randallc Posted August 22, 2006 Share Posted August 22, 2006 Not sure; maybe; GUICtrlDelete ( controlID )Randall? ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted August 22, 2006 Share Posted August 22, 2006 #include <GUIConstants.au3> #include <GuiList.au3> Opt ('MustDeclareVars', 1) Dim $msg, $ret Dim $listbox, $button GUICreate("ListBox Delete Item Demo", 400, 250, -1, -1) $listbox = GUICtrlCreateList("", 125, 40, 180, 120) GUICtrlSetData($listbox, "test1|test2|test3|") $button = GUICtrlCreateButton("Delete item #2", 150, 160, 120, 40) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button $ret = _GUICtrlListDeleteItem ($listbox, 1) If ($ret == $LB_ERR) Then MsgBox(16, "Error", "Unknown error from _GUICtrlListDeleteItem") EndIf EndSelect WEnd 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 More sharing options...
Tutech Posted August 22, 2006 Author Share Posted August 22, 2006 #include <GUIConstants.au3> #include <GuiList.au3> Opt ('MustDeclareVars', 1) Dim $msg, $ret Dim $listbox, $button GUICreate("ListBox Delete Item Demo", 400, 250, -1, -1) $listbox = GUICtrlCreateList("", 125, 40, 180, 120) GUICtrlSetData($listbox, "test1|test2|test3|") $button = GUICtrlCreateButton("Delete item #2", 150, 160, 120, 40) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $button $ret = _GUICtrlListDeleteItem ($listbox, 1) If ($ret == $LB_ERR) Then MsgBox(16, "Error", "Unknown error from _GUICtrlListDeleteItem") EndIf EndSelect WEnd Nice thing (I think). But two questions. Where do I get GuiList.au3 from? And the second thing: If I understand this in the correct way _GUICtrlListDeleteItem($listbox,1) deletes the item with index number one from list listbox? Is there an function available to get the index of the selected item? Is there any documentation available for GuiList.au3 ? It's not standard I think. Thanks Micha Link to comment Share on other sites More sharing options...
GaryFrost Posted August 22, 2006 Share Posted August 22, 2006 Nice thing (I think).But two questions. Where do I get GuiList.au3 from?And the second thing: If I understand this in the correct way _GUICtrlListDeleteItem($listbox,1) deletes the item with index number one from list listbox? Is there an function available to get the index of the selected item? Is there any documentation available for GuiList.au3 ? It's not standard I think.ThanksMichaLook in the UDF section of the help file from the latest release version (3.2.0.1) 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 More sharing options...
Tutech Posted August 22, 2006 Author Share Posted August 22, 2006 Look in the UDF section of the help file from the latest release version (3.2.0.1)Ok. Thanks for your help.Micha Link to comment Share on other sites More sharing options...
Tutech Posted August 22, 2006 Author Share Posted August 22, 2006 Ok. Thanks for your help.Micha Me again. Got now the latest release of AutoIt and GuiList.au3Is it just me or is this version of GuiList.au3 buggy? I got a bunch of errors by just including it.ThanksMicha Link to comment Share on other sites More sharing options...
GaryFrost Posted August 22, 2006 Share Posted August 22, 2006 Me again. Got now the latest release of AutoIt and GuiList.au3Is it just me or is this version of GuiList.au3 buggy? I got a bunch of errors by just including it.ThanksMichaIf using SciTE and Au3Check, make sure you have the latest of those also.I don't get any errors. 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 More sharing options...
Tutech Posted August 23, 2006 Author Share Posted August 23, 2006 If using SciTE and Au3Check, make sure you have the latest of those also.I don't get any errors.Ok. Thats it. Thanks.Have a nice day.Micha 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