在GUI上創(chuàng)建一個(gè) ListView 項(xiàng)目控件。
GUICtrlCreateListViewItem ( "文本", listviewID )
參數(shù)
| 文本 | 由豎線 | 分開(kāi)的子項(xiàng)目文本。 |
| listviewID | (此控件)所屬 ListView 控件的ID。 |
返回值
| 成功: | 返回控件標(biāo)識(shí)符(控件ID)。 |
| 失敗: | 返回值為0。 |
注意
本函數(shù)用于創(chuàng)建 ListView 項(xiàng)目,創(chuàng)建的項(xiàng)目和普通的控件一樣可以使用 GUICtrlSetData 設(shè)置相關(guān)數(shù)據(jù)。
相關(guān)
GUICtrlCreateListView, GUICtrlSetData, GUICtrlSetState, GUICtrlDelete, GUIGetMsg, GUICtrlRead
示例
#include <GUIConstants.au3>
GUICreate("listview items",220,250, 100,200,-1,$WS_EX_ACCEPTFILES)
GUISetBkColor (0x00E0FFFF) ; 更改背景顏色
$listview = GuiCtrlCreateListView ("col1 |col2|col3 ",10,10,200,150);,$LVS_SORTDESCENDING)
$button = GuiCtrlCreateButton ("Value?",75,170,70,20)
$item1=GuiCtrlCreateListViewItem("item2|col22|col23",$listview)
$item2=GuiCtrlCreateListViewItem("............item1|col12|col13",$listview)
$item3=GuiCtrlCreateListViewItem("item3|col32|col33",$listview)
$input1=GuiCtrlCreateInput("",20,200, 150)
GuiCtrlSetState(-1,$GUI_ACCEPTFILES) ; 允許拖放
GuiSetState()
GUICtrlSetData($item2,"|ITEM1",)
GUICtrlSetData($item3,"||COL33",)
GUICtrlDelete($item1)
Do
$msg = GuiGetMsg ()
Select
Case $msg = $button
MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2)
Case $msg = $listview
MsgBox(0,"listview", "clicked="& GuiCtrlGetState($listview),2)
EndSelect
Until $msg = $GUI_EVENT_CLOSE
辽源市| 通许县| 盐亭县| 山阳县| 黄骅市| 松原市| 屯留县| 平邑县| 全南县| 新巴尔虎右旗| 缙云县| 固安县| 大姚县| 克拉玛依市| 扬中市| 乌苏市| 新邵县| 巴彦县| 吕梁市| 西林县| 桦南县| 石阡县| 常宁市| 文安县| 罗山县| 东丽区| 鄂州市| 皮山县| 上虞市| 南澳县| 盐山县| 淳安县| 班戈县| 哈尔滨市| 开阳县| 琼中| 武隆县| 隆德县| 陵川县| 启东市| 浦城县|