本帖最后由 chzj589 于 2016-12-12 10:09 编辑
能上个代码吗?很难吗?
dnvplj 发表于 2016-12-12 09:14
你说呢?
多看帮助文件,了解GUICtrlCreateListView控件的使用
_GUICtrlListView_AddSubItem
添加列表视图子项.
#include <GUIConstantsEx.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
Example()
Func Example()
Local $hImage, $idListview
; 创建 GUI
GUICreate("添加列表视图子项", 400, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
GUISetState(@SW_SHOW)
; 加载图像
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($idListview), 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($idListview), 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($idListview), 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($idListview, $hImage, 1)
; 添加列
_GUICtrlListView_InsertColumn($idListview, 0, "列 1", 100)
_GUICtrlListView_InsertColumn($idListview, 1, "列 2", 100)
_GUICtrlListView_InsertColumn($idListview, 2, "列 3", 100)
; 添加项目
_GUICtrlListView_AddItem($idListview, "行 1: 列 1", 0)
_GUICtrlListView_AddSubItem($idListview, 0, "行 1: 列 2", 1, 1)
_GUICtrlListView_AddSubItem($idListview, 0, "行 1: 列 3", 2, 2)
_GUICtrlListView_AddItem($idListview, "行 2: 列 1", 1)
_GUICtrlListView_AddSubItem($idListview, 1, "行 2: 列 2", 1, 2)
_GUICtrlListView_AddItem($idListview, "行 3: 列 1", 2)
; 循环到用户退出.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
|