本帖最后由 872777825 于 2010-12-30 23:23 编辑
无意在帮助里看到以下例子#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
Opt('MustDeclareVars', 1)
$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $hImage, $hListView
; 创建界面
GUICreate("列表中添加项目", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
_GUICtrlListView_SetUnicodeFormat($hListView, False)
GUISetState()
; 加载图像
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)
; 添加列
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
; 添加项目
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)
; 循环至用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
例子中加载的是色彩 那如果加载 ico 等格式的小图标 又该怎么写呢 例如
这样的样式
小弟试了几次 还是不行 最多就是现实一个黑色的方块 没办法只能向各位老师求救了
希望有空的老师指点下 谢谢 |