#include "ListViewEditInput.au3" #include #include #include Opt("GuiOnEventMode",1) $hGui=GUICreate("ListviewEditExample",420,340,-1,-1) $iListView=GUICtrlCreateListView("Col 1|Col 2|Col 3",10,10,200,280) $iListView2=GUICtrlCreateListView("Col 1|Col 2|Col 3",215,10,200,280) $hLabel=GUICtrlCreateLabel("Nothing happened yet",10,300,300,25) for $i=0 to 10 step 1 GUICtrlCreateListViewItem($i&":0"&"|"&$i&":1"&"|"&$i&":2", $iListView) GUICtrlCreateListViewItem($i&":0"&"|"&$i&":1"&"|"&$i&":2", $iListView2) next __ListViewEditInput_ListViewAdd($hGui, $iListView, "2") __ListViewEditInput_ListViewAdd($hGui, $iListView2, Default, "4", True) __ListViewEditInput_RegisterFunction($iListView, "_edited", "changed") __ListViewEditInput_RegisterFunction($iListView, "_canceled", "canceled") ; disable listview editing ;__ListViewEditInput_ListViewRemove($hListView2) GUISetOnEvent($GUI_EVENT_CLOSE, "_close") GUISetState(@SW_SHOW, $hGui) While Sleep(10) WEnd Func _close() Exit EndFunc Func _edited($hListView, $iIndex, $iSubIndex) If GUICtrlGetHandle($iListView)=$hListView Then ConsoleWrite("That was the first listview :)"&@crlf) GUICtrlSetData($hLabel,"Changed: "&$hListView&": "&$iIndex&":"&$iSubIndex) EndFunc Func _canceled($hListView, $iIndex, $iSubIndex) GUICtrlSetData($hLabel,"Canceled: "&$hListView&": "&$iIndex&":"&$iSubIndex) EndFunc