創(chuàng)建 ListView 控件的項目.
GUICtrlCreateListViewItem ( "文本", 控件 ID
)
文本 | 由 Opt("GUIDataSeparatorChar") 設(shè)置分隔符分隔的項目文本. |
控件 ID | ListView 控件標(biāo)識符. |
成功: | 返回控件標(biāo)識符(控件ID). |
失敗: | 返回 0. |
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example()
Func Example()
Local
$listview,
$button,
$item1,
$item2,
$item3,
$msg
GUICreate("列表視圖項目", 220, 250, 100, 200, -1,
$WS_EX_ACCEPTFILES)
GUISetBkColor(0x00E0FFFF) ;
改變背景顏色
$listview = GUICtrlCreateListView("列1 |列2|列3
", 10, 10, 200, 150);,$LVS_SORTDESCENDING)
$button = GUICtrlCreateButton("選擇結(jié)果 ?", 75,
170, 70, 20)
$item1 = GUICtrlCreateListViewItem ("項目 2|列22|列23", $listview)
$item2 = GUICtrlCreateListViewItem ("............項目
1|列12|列13", $listview)
$item3 = GUICtrlCreateListViewItem ("項目 3|列32|列33", $listview)
GUICtrlCreateInput("", 20, 200, 150)
GUICtrlSetState(-1, $GUI_DROPACCEPTED) ; 允許拖放
GUISetState()
GUICtrlSetData($item2, "|項目
1")
GUICtrlSetData($item3, "||列33")
GUICtrlDelete($item1)
Do
$msg = GUIGetMsg()
Select
Case $msg
= $button
MsgBox(0,
"列表視圖項目 ",
GUICtrlRead(GUICtrlRead($listview)), 2)
Case $msg
= $listview
MsgBox(0,
"列表視圖",
"點(diǎn)擊列=" &
GUICtrlGetState($listview), 2)
EndSelect
Until
$msg = $GUI_EVENT_CLOSE
EndFunc ;==>Example
provider with jb51.net (unicode) |