本帖最后由 ipmitool 于 2016-6-3 19:51 编辑
請問大大, 要如何讓滑鼠點擊某一行兩下之後, 讀出點到的值, 然後帶到msgbox呢? Thanks
1.txt
sdfasdfsadfasdadfasdfasdfasdfs!ER#$@sdfasdfsadfasdadfasdfasdfas
2.txt
sdfasdfsad@fasdadfasdfasdfasdfs!ER#$@sdfasdfsadfasdadfasdfasdfas
sdfasdfsadfasdadfasdfasdfasdfs!ER#$@sdfasdfsadfasdadfasdfasdfas
3.txt
sdfsdfsf@w32
dsfgsg@dvsfgds
advsfgfhnjt5
Sdsdfgdgdgh
dsfw43@wrgt35y45@jmryjr
4.txt
advfssfdfbg5324353@wr535t3y
ergergy43@243453
@Vadgwrgwg
VDsaf@gryjhr#include <Array.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
;#include <MsgBoxConstants.au3>
GUICreate("ListView Add Array", 800, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
GUISetState(@SW_SHOW)
_GUICtrlListView_AddColumn($idListview, "Tester", 100)
_GUICtrlListView_AddColumn($idListview, "Test Item", 100)
_GUICtrlListView_AddColumn($idListview, "BMC IP", 100)
_GUICtrlListView_AddColumn($idListview, "Count", 100)
_GUICtrlListView_AddColumn($idListview, "Last Record Time", 100)
_GUICtrlListView_SetItemCount($idListview, 5000)
_add_lv_items()
AdlibRegister('_add_lv_items', 5000); 5秒刷新数据
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func _add_lv_items()
Local $path, $aFileList, $aNewList[1][2]
$path = @ScriptDir
$aFileList = _FileListToArray($path, "*.txt")
If IsArray($aFileList) Then
ReDim $aNewList[UBound($aFileList)][5] ;;;[Col count]
For $i = 0 To UBound($aFileList) - 1 Step 1
$aNewList[$i][0] = $aFileList[$i]
$aNewList[$i][1] = FileReadLine($aFileList[$i], 1)
$aNewList[$i][2] = FileReadLine($aFileList[$i], 2)
$aNewList[$i][3] = FileReadLine($aFileList[$i], 3)
$aNewList[$i][4] = FileReadLine($aFileList[$i], 4)
Next
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($idListview))
_GUICtrlListView_AddArray($idListview, $aNewList)
EndIf
EndFunc
|