home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / shareware / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlListViewDeleteAllItems.au3 < prev    next >
Encoding:
Text File  |  2006-06-17  |  1.1 KB  |  33 lines

  1. #include <GuiConstants.au3>
  2. #include <GuiListView.au3>
  3.  
  4. Opt ('MustDeclareVars', 1)
  5. Dim $listview, $Btn_DeleteAll, $Btn_Exit, $msg, $ret, $Status
  6. GUICreate("ListView Delete All Items", 392, 322)
  7.  
  8. $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149)
  9. GUICtrlCreateListViewItem("line1|data1|more1", $listview)
  10. GUICtrlCreateListViewItem("line2|data2|more2", $listview)
  11. GUICtrlCreateListViewItem("line3|data3|more3", $listview)
  12. GUICtrlCreateListViewItem("line4|data4|more4", $listview)
  13. GUICtrlCreateListViewItem("line5|data5|more5", $listview)
  14. $Btn_DeleteAll = GUICtrlCreateButton("Delete All Items", 150, 200, 90, 40)
  15. $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30)
  16. $Status = GUICtrlCreateLabel("", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))
  17.  
  18. GUISetState()
  19. While 1
  20.     $msg = GUIGetMsg()
  21.     Select
  22.         Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit
  23.             ExitLoop
  24.         Case $msg = $Btn_DeleteAll
  25.             If (_GUICtrlListViewDeleteAllItems ($listview)) Then
  26.                 GUICtrlSetData($Status, 'Deleted All Items')
  27.             Else
  28.                 GUICtrlSetData($Status, 'Delete Failed')
  29.             EndIf
  30.     EndSelect
  31. WEnd
  32. Exit
  33.