看了下帮助凡是带图标没用GUICtrlCreateListViewItem增加项目,不知道是不是他影响了~#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WinAPI.au3>
#include <WindowsConstants.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)
_GUICtrlListView_SetImageList($ListView1, $hImage, 1)
$Button_1 = GUICtrlCreateButton("修改12的图标", 10, 180)
$Button_2 = GUICtrlCreateButton("修改14的图标", 10, 230)
For $i = 0 To 4
_GUICtrlListView_AddItem($ListView1, $i)
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 175)
For $j = 0 To 4
_GUICtrlListView_AddSubItem($ListView1, $i, $j & $i, $j)
Next
Next
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button_1
_GUIImageList_SetIconSize($hImage, 32, 32)
For $i = 0 To 4
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 13)
Next
_GUICtrlListView_SetImageList($ListView1, $hImage, 1)
EndSwitch
WEnd
|