xtgss007 发表于 2011-10-13 01:58:49

在GUICtrlCreateListViewItem中显示图片问题

请问各位大神 如何在GUICtrlCreateListViewItem这个控件 中一个图片,比如

在红框中显示,
代码为:$litem1 = GUICtrlCreateListViewItem ($t1&"|"&$t2&"|"&$t3&"|"&$t4&"|"&$t5&"|"&$t6&"|"&$t7,$List1)

xms77 发表于 2011-10-13 03:42:16

试试可不可以把GUICtrlCreatePic这个控件加到Item控件里面

xtgss007 发表于 2011-10-13 06:13:16

试过楼上的方法,不行的,真是悲剧啊

autoit3CN 发表于 2011-10-13 06:40:09

#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()

autoit3CN 发表于 2011-10-13 06:41:46

回复 3# xtgss007


   参考UDF: GuiImageList

xtgss007 发表于 2011-10-13 15:17:31


autoit3CN 发表于 2011-10-13 06:40 http://www.autoitx.com/images/common/back.gif


    谢谢autoit3CN, 如果是其它格式,比如gif,jpg等格式该如何来实现 ?
页: [1]
查看完整版本: 在GUICtrlCreateListViewItem中显示图片问题