回复 6# kk_lee69
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
Local $yel = "90" ;总和
Local $ye2 = "80" ;总和
Local $ye3 = "70"
Local $i = 0
Local $idListview, $hImage
Example()
Func Example()
; Local $sWow64 = ""
;If @AutoItX64 Then $sWow64 = "\Wow6432Node"
; Local $sAutoItDir = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir")
$hGUI = GUICreate("ImageList 复制图像", 410, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 404, 268, $LVS_REPORT, $WS_EX_CLIENTEDGE);;, BitOR($LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER, $LVS_REPORT))
_GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_INFOTIP, $LVS_EX_SUBITEMIMAGES))
GUISetState(@SW_SHOW)
; 创建图像图像列表和图像
$hImage = _GUIImageList_Create(20, 20)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\AAA.ICO") & @CRLF)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\223.ico") & @CRLF)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\C01.ico") & @CRLF)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\linea.ico") & @CRLF)
_GUIImageList_Copy($hImage, 0, 1)
_GUICtrlListView_SetImageList($idListview, $hImage, 1)
; 添加列
_GUICtrlListView_AddColumn($idListview, "列 1", 100, 1, 1, True)
_GUICtrlListView_AddColumn($idListview, "列 2", 100, 0, 0, True)
_GUICtrlListView_AddColumn($idListview, "列 3", 100, 2, 2, True)
_GUICtrlListView_AddColumn($idListview, "列 4", 100, 0, 3)
_du()
; 循环到用户退出.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
Func _du()
$hImage = _GUIImageList_Create(20, 20)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\AAA.ICO") & @CRLF)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\223.ico") & @CRLF)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\C01.ico") & @CRLF)
ConsoleWrite(_GUIImageList_AddIcon($hImage, @ScriptDir & "\linea.ico") & @CRLF)
;_GUIImageList_Copy($hImage, 0, 1)
_GUICtrlListView_SetImageList($idListview, $hImage, 1)
For $ii = 0 To 3
_GUICtrlListView_AddItem($idListview, $i, 0)
_GUICtrlListView_AddSubItem($idListview, $i, $yel, 1, 1)
_GUICtrlListView_AddSubItem($idListview, $i, $ye2, 2, 2)
_GUICtrlListView_AddSubItem($idListview, $i, $ye3, 3, 3)
$i += 1
Next
EndFunc ;==>_du
|