目前测试这样,但图标不是透明背景,郁闷#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Local $hImage, $hListView
; Create GUI
$gui=GUICreate("ListView Set Icon Spacing", 800, 600)
$hListView = _GUICtrlListView_Create($gui, "", 2, 2, 596, 500, -1, -1, True)
_GUICtrlListView_SetView($hListView, 1)
GUISetState()
; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_SetIconSize($hImage,32,32)
_GUIImageList_SetBkColor($hImage,0xffffff)
_GUIImageList_AddIcon($hImage, @WindowsDir&"\notepad.exe",0,True) ;读取图标
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 48, 48))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 48, 48))
_GUICtrlListView_SetImageList($hListView, $hImage, 0)
_GUICtrlListView_SetBkImage($hListView, @ScriptDir & "\img1.jpg")
; Add items
_GUICtrlListView_AddItem($hListView, "Item 1", 0)
_GUICtrlListView_AddItem($hListView, "Item 2", 1)
_GUICtrlListView_AddItem($hListView, "Item 3", 2)
; Change item spacing
;MsgBox(4160, "Information", "Changing icon spacing")
_GUICtrlListView_SetIconSpacing($hListView, 64, 64)
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
|