本帖最后由 kaitou8 于 2012-2-16 19:40 编辑 #include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $hImage, $hListView
; Create GUI
GUICreate("ListView Add SubItem", 400, 300)
GUICtrlCreateButton('显示选中行的第1列',100,280,160,18)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
GUISetState()
; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)
; Add items
For $i = 0 To 1999
_GUICtrlListView_AddItem($hListView, "Row "&$i+1&": Col 1", $i)
For $j = 1 To 2
_GUICtrlListView_AddSubItem($hListView,$i , "Row "&$i+1&": Col "&$j+1, $j)
Next
Next
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
读取选中那行的第一列内容... 用guictrlread(guictrlread($hlistview)) 输出0
求方法
感谢两大神... |