cheese Posted November 6, 2009 Posted November 6, 2009 (edited) Hi! Why it don't works? #include <GuiConstantsEx.au3> #include <GuiListView.au3> $Gui = GUICreate("_GUICtrlListView_DeleteAllItems",300,200) $btnAdd = GUICtrlCreateButton("Add",2,2,120,23) $btnDel = GUICtrlCreateButton("Delete",134,2,120,23) $hListView = GUICtrlCreateListView("Items",2,27,296,171) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btnAdd For $i = 1 To 5 _GUICtrlListView_AddItem($hListView,$i) GUICtrlSetData($btnDel,"Delete") Next Case $btnDel _GUICtrlListView_DeleteAllItems($hListView) GUICtrlSetData($btnDel,"Why It Not Work?") EndSwitch WEnd GUIDelete() Edited November 6, 2009 by cheese
Achilles Posted November 6, 2009 Posted November 6, 2009 I'm not sure why it doesn't work. This does: (just added a GUICtrlGetHandle around the $hListview) #include <GuiConstantsEx.au3> #include <GuiListView.au3> $Gui = GUICreate("_GUICtrlListView_DeleteAllItems",300,200) $btnAdd = GUICtrlCreateButton("Add",2,2,120,23) $btnDel = GUICtrlCreateButton("Delete",134,2,120,23) $hListView = GUICtrlCreateListView("Items",2,27,296,171) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btnAdd For $i = 1 To 5 _GUICtrlListView_AddItem($hListView,$i) GUICtrlSetData($btnDel,"Delete") Next Case $btnDel _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($hListView)) GUICtrlSetData($btnDel,"Why It Not Work?") EndSwitch WEnd GUIDelete() My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
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