#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Global $from1, $ListView1
$Form1 = GUICreate("我的列表", 360, 320)
$hImage = _GUIImageList_Create(16, 16, 5, 3)
$ListView1 = GUICtrlCreateListView("列a|列b|列c|列d|列e", 8, 8, 361, 150)
GUICtrlSendMsg($ListView1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
$Button_1 = GUICtrlCreateButton("修改12的图标", 10, 180)
$Button_2 = GUICtrlCreateButton("修改14的图标", 10, 230)
Dim $list[5]
For $i = 0 To 4
$list[$i] = GUICtrlCreateListViewItem($i & "|1" & $i & "|2" & $i & "|3" & $i & "|4" & $i, $ListView1)
GUICtrlSetImage(-1, "shell32.dll", 18)
Next
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button_1
$con = ControlListView($from1, "", $ListView1, "FindItem", "12", 1)
If $con <> -1 Then
;;这里设置listviewitem图标
;;;
GUICtrlSetImage($list[$con], "shell32.dll", 12)
EndIf
EndSwitch
WEnd
|