#include #include #include "GUIListViewEx.au3" #include Global $lw_col2 = 0xCECBCE Global $lw_col1 = 0xADAAAD $hGUI = GUICreate("Example Listview", 600, 300) $lw_Example = GUICtrlCreateListView("", 10, 10, 500, 280, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS)) _GUICtrlListView_SetExtendedListViewStyle($lw_Example, $LVS_EX_FULLROWSELECT) _GUICtrlListView_AddColumn($lw_Example, "ID", 40) ;0 _GUICtrlListView_AddColumn($lw_Example, "COL1", 138) ;1 _GUICtrlListView_AddColumn($lw_Example, "COL2", 300) ;2 _GUICtrlListView_SetBkColor($lw_Example,$lw_col1) _GUICtrlListView_SetTextColor($lw_Example, $CLR_BLACK) _GUICtrlListView_SetTextBkColor($lw_Example,$lw_col1) GUICtrlSetFont($lw_Example, 11, 400,1) $iCurrentColor_lw_Example = $lw_col2 For $i = 0 To 20 $sRecord = "0" & "|" $sRecord &= "list" & "|" $sRecord &= $i & "|" $ctrItemListview_Func = GUICtrlCreateListViewItem($sRecord, $lw_Example) if $iCurrentColor_lw_Example = $lw_col2 Then $iCurrentColor_lw_Example = $lw_col1 Else $iCurrentColor_lw_Example = $lw_col2 EndIf GUICtrlSetBkColor($ctrItemListview_Func, $iCurrentColor_lw_Example) Next $iListviewIndex_lw_Example = _GUIListViewEx_Init($lw_Example, "", 1, 0xFFFFFF, False, 512) _GUIListViewEx_SetEditStatus($iListviewIndex_lw_Example, 0,0) _GUIListViewEx_SetEditStatus($iListviewIndex_lw_Example, 1,1) _GUIListViewEx_SetEditStatus($iListviewIndex_lw_Example, 2, 2, "Choice1|Choice2|Choice3", True) _GUIListViewEx_EditWidth($iListviewIndex_lw_Example, 400) GUISetState() _GUIListViewEx_MsgRegister() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch $vRet = _GUIListViewEx_EventMonitor(0) ; Use combos to change EditMode Switch @extended Case 0 ; No event detected Case 1 If $vRet = "" Then MsgBox($MB_SYSTEMMODAL, "Edit", "Edit aborted" & @CRLF) Else _ArrayDisplay($vRet, "ListView " & _GUIListViewEx_GetActive() & " content edited", Default, 8) EndIf Case 2 If $vRet = "" Then MsgBox($MB_SYSTEMMODAL, "Header edit", "Header edit aborted" & @CRLF) Else _ArrayDisplay($vRet, "ListView " & _GUIListViewEx_GetActive() & " header edited", Default, 8) EndIf Case 3 MsgBox($MB_SYSTEMMODAL, "Sorted", "ListView: " & $vRet & @CRLF) Case 4 Tooltip("") MsgBox($MB_SYSTEMMODAL, "Dragged", "From : To" & @CRLF & $vRet & @CRLF) EndSwitch WEnd