ipmitool 发表于 2016-6-2 09:07:23

[已解決]請問大大, 要如何讓滑鼠點擊某一行兩下, 讀出值, 然後帶到msgbox呢?

本帖最后由 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
      $path = @ScriptDir
      $aFileList = _FileListToArray($path, "*.txt")
      If IsArray($aFileList) Then

                ReDim $aNewList ;;;
                For $i = 0 To UBound($aFileList) - 1 Step 1
                        $aNewList[$i] = $aFileList[$i]
                        $aNewList[$i] = FileReadLine($aFileList[$i], 1)
                        $aNewList[$i] = FileReadLine($aFileList[$i], 2)
                        $aNewList[$i] = FileReadLine($aFileList[$i], 3)
                        $aNewList[$i] = FileReadLine($aFileList[$i], 4)

                Next
                _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($idListview))
                _GUICtrlListView_AddArray($idListview, $aNewList)
      EndIf
EndFunc

yohoboy 发表于 2016-6-2 23:38:12

1. GUIRegisterMsg
2._GUICtrlListView_GetHotItem
先從這兩個下手
可以參考我貼的帖看看SQLITE資料庫操作及輸出.CVS和HTML檔裡面有你需要的碼可參考看看。

ipmitool 发表于 2016-6-3 19:50:59

搞定了
MsgBox($MB_SYSTEMMODAL, "Information", "Item 2 Text: " & _GUICtrlListView_GetItemText($idListview, 2))

ipmitool 发表于 2016-6-7 10:47:32

請問如何偵測每行資料, 10分鐘沒更新狀態, 就回報msg error呢? 謝謝各位大大

ddrs 发表于 2016-6-7 13:41:54

不错的,都可以学学下
页: [1]
查看完整版本: [已解決]請問大大, 要如何讓滑鼠點擊某一行兩下, 讀出值, 然後帶到msgbox呢?