使用GUICtrlCreateListView创建的listview如何添加背景图?
部份代码如下,使用_GUICtrlListView_SetBkImage设置没效。。 使用_GUICtrlListView_Create创建的有效,但这种方式,我不懂怎样添加图标--样式 1效果,我想模拟桌面图标效果。。请各位帮忙.$hListView2 = GUICtrlCreateListView("", 0, 70, 800, 530, $WS_BORDER)_GUICtrlListView_SetExtendedListViewStyle($hListView2, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER))
_GUICtrlListView_SetView($hListView2, 1);设置样式,可选(1、2、3、4)
GUICtrlSetResizing($hListView2, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM);设置某个控件的大小调整方式
_GUICtrlListView_SetBkImage(GUICtrlGetHandle($hListView2), @ScriptDir & "\img1.jpg")
_GUICtrlListView_EnableGroupView($hListView2)
帮顶了,没人知道吗? 目前测试这样,但图标不是透明背景,郁闷#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() 自己解决。。
$hImage = _GUIImageList_Create(32,32,5,2)
页:
[1]