#include #include #include #include #include Global $Form1, $ListView1, $btn_RemoveAll, $btn_RemoveAllFinished, $LVGroup_Unfinished, $LVGroup_Finished #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Remove Finished Items", 615, 389, -1, -1) $ListView1 = GUICtrlCreateListView("Name|Status", 8, 8, 594, 318) _GUICtrlListView_SetColumnWidth($ListView1, 0, 285) _GUICtrlListView_SetColumnWidth($ListView1, 1, 300) _GUICtrlListView_EnableGroupView($ListView1, True) $LVGroup_Finished = _GUICtrlListView_InsertGroup($ListView1, -1, 1, "Finished", 0) $LVGroup_Unfinished = _GUICtrlListView_InsertGroup($ListView1, -1, 2, "Unfinished", 0) $btn_RemoveAll = GUICtrlCreateButton("Remove All", 136, 344, 115, 33) $btn_RemoveAllFinished = GUICtrlCreateButton("Remove All Finished", 341, 342, 115, 33) GUISetState(@SW_SHOW) _Create_ListViewItems() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn_RemoveAll _RemoveAllItems() Case $btn_RemoveAllFinished _GUICtrlListView_DeleteAllItems($LVGroup_Finished) EndSwitch WEnd Func _RemoveAllItems() _GUICtrlListView_DeleteAllItems($ListView1) EndFunc ;==>_RemoveAllItems Func _Create_ListViewItems() For $i = 1 To 20 If $i < 8 Then $iIndex = _GUICtrlListView_AddItem($ListView1, "Test Item-" & $i) _GUICtrlListView_AddSubItem($ListView1, $iIndex, "Finished", 1) _GUICtrlListView_SetItemGroupID($ListView1, $iIndex, 1) Else $iIndex = _GUICtrlListView_AddItem($ListView1, "Test Item-" & $i) _GUICtrlListView_AddSubItem($ListView1, $iIndex, "Unfinished", 1) _GUICtrlListView_SetItemGroupID($ListView1, $iIndex, 2) EndIf Next EndFunc ;==>_Create_ListViewItems