晕,这个问题真是....#include <GuiListView.au3>
#include <GUIConstants.au3>
Dim $data_array[4] = ["", "192.168.1.6 | HP-968B0D898 | Administrator|16:44:31|24/04/2009", _
"192.168.1.6 | HP-968B0D898 | Administrator|16:45:08|24/04/2009", _
"192.168.1.6 | HP-968B0D898 | Administrator|16:45:14|24/04/2009"]
Dim $data_count = 3
$GUI = GuiCreate("", 600, 300, 300, 300)
GUISetFont(9, 400, 0, "Lucida Console")
$hListView = GuiCtrlCreateListView("", 5, 5, 550, 200)
_GUICtrlListView_AddColumn($hListView, "IP ADDRESS", 120)
_GUICtrlListView_AddColumn($hListView, "COMPUTER TYPE", 120)
_GUICtrlListView_AddColumn($hListView, "USER", 124)
_GUICtrlListView_AddColumn($hListView, "DATE", 90)
_GUICtrlListView_AddColumn($hListView, "TIME", 90)
GUISetState(@SW_SHOW, $GUI)
For $x = 1 to $data_count
$y = StringSplit($data_array[$x], "|")
_GUICtrlListView_AddItem($hListView, $y[1])
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y[2], 1)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y[3], 2)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y[5], 3)
_GUICtrlListView_AddSubItem($hListView, $x - 1, $y[4], 4)
Next
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
代码前加一句:#include <GUIConstants.au3>
末尾加一段while循环来触发gui的事件:例如你想要‘不自动退出,除非按退出(X)’ |