本帖最后由 saigi 于 2012-1-14 19:59 编辑
_GUICtrlListView_GetEditControl() 返回句柄后 _GUICtrlEdit_GetText()读取
试了后也读不到,不知道是哪边出了问题
附上原始档#include <Array.au3>
#include <EditConstants.au3>
#Include <GuiEdit.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
Local $ListView[2]
Local $Item1[7]
Local $ItemA , $ItemB
Local $Set1[10]=["A","B","C","D","E","F","G"]
Opt("GUIOneventMode",1)
$WinMain = GUICreate("Test", 375, 530, -1, -1,WinGetHandle("Program Manager"))
$ListView[1] = GUICtrlCreateListView("", 15, 40, 340, 442,$LVS_EDITLABELS,$LVS_EX_GRIDLINES+$LVS_EX_FULLROWSELECT)
_GUICtrlListView_AddColumn($ListView[1], "001", 200, 0)
For $NumA=0 To 6 Step 1
$Item1[$NumA]=GUICtrlCreateListViewItem($Set1[$NumA], $ListView[1])
Next
GUISetOnEvent($GUI_EVENT_CLOSE, "GUICtrlMsg")
For $NumA=0 To 6 Step 1
GUICtrlSetOnEvent($Item1[$NumA],"SendInsAA")
Next
$LABEL1 = GUICTRLCREATELABEL("", 300, 20, 50, 15)
$LABEL2 = GUICTRLCREATELABEL("", 100, 20, 50, 15)
GUISetState(@SW_SHOW)
While 1
Sleep(500)
$ItemB = _GUICtrlEdit_GetText($ItemA)
GUICtrlSetData($LABEL1,$ItemA)
GUICtrlSetData($LABEL2,$ItemB)
WEnd
Func SendInsAA()
$ItemId = _ArraySearch($Item1, @GUI_CtrlId)
_GUICtrlListView_EditLabel($ListView[1], $ItemId)
$ItemA =_GUICtrlListView_GetEditControl($ListView[1])
EndFunc
Func GUICtrlMsg()
Exit
EndFunc
|