#include <GuiConstantsEx.au3>
#include <WinAPI.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
Local $listview, $hImage
GUICreate("ListViewItem中显示图片演示", 400, 300)
$listview = GUICtrlCreateListView("我的图片 |图片信息", 2, 2, 394, 268)
GUISetState()
; 加载映像
$hImage = _GUIImageList_Create(106, 66)
_GUIImageList_AddBitmap($hImage, "1.bmp");放在脚本同一目录
_GUIImageList_AddBitmap($hImage, "2.bmp");放在脚本同一目录
_GUIImageList_AddBitmap($hImage, "3.bmp");如果要添加第三张图
_GUICtrlListView_SetImageList($listview, $hImage, 1)
; 添加项目
_GUICtrlListView_AddItem($listview, "", 0, 1)
_GUICtrlListView_AddSubItem($listview, 0, '风景如画', 1, 1)
_GUICtrlListView_AddItem($listview, "", 1, 2)
_GUICtrlListView_AddSubItem($listview, 1, "随意说说", 1, 1)
;_GUICtrlListView_AddItem($listview, "", 2, 2);如果要添加第三张图
;_GUICtrlListView_AddSubItem($listview, 2, "随意说说", 1, 1);如果要添加第三张图
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
|