#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <guilistview.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$ListView1 = GUICtrlCreateListView("", 16, 16, 577, 337)
$Button1 = GUICtrlCreateButton("Button1", 24, 376, 75, 25)
$Button2 = GUICtrlCreateButton("Button2", 120, 376, 75, 25)
$Button3 = GUICtrlCreateButton("Button3", 200, 376, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_guictrllistview_addcolumn($ListView1,"test1",150)
_guictrllistview_addcolumn($ListView1,"test2",150)
_guictrllistview_addcolumn($ListView1,"test3",150)
_GUICtrlListView_AddItem($ListView1,"item1")
_GUICtrlListView_AddSubItem($ListView1,0,"item1-1",0)
_GUICtrlListView_AddSubItem($ListView1,0,"item1-2",1)
_GUICtrlListView_AddSubItem($ListView1,0,"item1-3",2)
_GUICtrlListView_AddItem($ListView1,"item2")
_GUICtrlListView_AddSubItem($ListView1,1,"item2-1",0)
_GUICtrlListView_AddSubItem($ListView1,1,"item2-2",1)
_GUICtrlListView_AddSubItem($ListView1,1,"item2-3",2)
_GUICtrlListView_AddItem($ListView1,"item3")
_GUICtrlListView_AddSubItem($ListView1,2,"item3-1",0)
_GUICtrlListView_AddSubItem($ListView1,2,"item3-2",1)
_GUICtrlListView_AddSubItem($ListView1,2,"item3-3",2)
;~ Local $i ;循环方式添加ITEM-------guictrlcreatlistviewitem()
;~ For $i=1 To 3
;~ GUICtrlCreateListViewItem("item"&$i&"-1|item"&$i&"-2|item"&$i&"-3",$ListView1)
;~ Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_GUICtrlListView_DeleteItem($ListView1,1)
;~ _GUICtrlListView_BeginUpdate($ListView1)
;~
;~ _GUICtrlListView_EndUpdate($ListView1)
;~ _GUICtrlListView_AddItem($ListView1,"item3")
;~ _GUICtrlListView_AddSubItem($ListView1,2,"item3-1",0)
;~ _GUICtrlListView_AddSubItem($ListView1,2,"item3-2",1)
;~ _GUICtrlListView_AddSubItem($ListView1,2,"item3-3",2)
Case $Button2
_GUICtrlListView_DeleteColumn($ListView1,2)
Case $Button3
_GUICtrlListView_DeleteItemsSelected($ListView1)
EndSwitch
WEnd